Skip to content

Commit db0f893

Browse files
authored
Merge pull request #31 from libgit2/cmn/update-dist-llvm
Update dependencies in Travis to something current
2 parents 23fab53 + d8374dc commit db0f893

File tree

5 files changed

+88
-21
lines changed

5 files changed

+88
-21
lines changed

.travis.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
language: ruby
2+
dist: xenial
3+
addons:
4+
apt:
5+
packages:
6+
- libclang-6.0-dev
7+
- llvm-6.0
28
rvm:
3-
- ruby-2.0
4-
- ruby-2.1
9+
- ruby-2.4
10+
- ruby-2.5
511
- ruby-head
6-
- rbx
712

813
env:
9-
- LLVM_CONFIG=llvm-config-3.3
10-
11-
before_install:
12-
- sudo apt-get update
13-
- sudo apt-get install libclang-3.3-dev llvm-3.3
14+
- LLVM_CONFIG=llvm-config-6.0

docurium.gemspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Gem::Specification.new do |s|
2020
s.add_dependency "rugged", "~>0.21"
2121
s.add_dependency "redcarpet", "~>3.0"
2222
s.add_dependency "ffi-clang", "~> 0.5"
23-
s.add_development_dependency "bundler", "~>1.0"
2423
s.add_development_dependency "rake", "~> 12"
2524
s.add_development_dependency "minitest", "~> 5.11"
2625

test/docurium_test.rb

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,64 @@ def test_can_extract_structs_and_enums
6262

6363
def test_can_find_type_usage
6464
oid = @data[:types].assoc('git_oid')
65-
assert_equal 10, oid[1][:used][:returns].size
66-
assert_equal 39, oid[1][:used][:needs].size
65+
oid_returns = [
66+
"git_commit_id",
67+
"git_commit_parent_oid",
68+
"git_commit_tree_oid",
69+
"git_object_id",
70+
"git_odb_object_id",
71+
"git_oid_shorten_new",
72+
"git_reference_oid",
73+
"git_tag_id",
74+
"git_tag_target_oid",
75+
"git_tree_entry_id",
76+
"git_tree_id"
77+
]
78+
assert_equal oid_returns, oid[1][:used][:returns]
79+
oid_needs = [
80+
"git_blob_create_frombuffer",
81+
"git_blob_create_fromfile",
82+
"git_blob_lookup",
83+
"git_commit_create",
84+
"git_commit_create_o",
85+
"git_commit_create_ov",
86+
"git_commit_create_v",
87+
"git_commit_lookup",
88+
"git_object_lookup",
89+
"git_odb_exists",
90+
"git_odb_hash",
91+
"git_odb_open_rstream",
92+
"git_odb_read",
93+
"git_odb_read_header",
94+
"git_odb_write",
95+
"git_oid_allocfmt",
96+
"git_oid_cmp",
97+
"git_oid_cpy",
98+
"git_oid_fmt",
99+
"git_oid_mkraw",
100+
"git_oid_mkstr",
101+
"git_oid_pathfmt",
102+
"git_oid_shorten_add",
103+
"git_oid_shorten_free",
104+
"git_oid_to_string",
105+
"git_reference_create_oid",
106+
"git_reference_create_oid_f",
107+
"git_reference_set_oid",
108+
"git_revwalk_hide",
109+
"git_revwalk_next",
110+
"git_revwalk_push",
111+
"git_tag_create",
112+
"git_tag_create_f",
113+
"git_tag_create_fo",
114+
"git_tag_create_frombuffer",
115+
"git_tag_create_o",
116+
"git_tag_lookup",
117+
"git_tree_create_fromindex",
118+
"git_tree_lookup",
119+
"git_treebuilder_insert",
120+
"git_treebuilder_write"
121+
]
122+
assert_equal oid_needs, oid[1][:used][:needs].sort
67123
end
68124

69125
def test_can_parse_normal_functions
@@ -104,7 +160,12 @@ def test_can_parse_function_cast_args
104160
assert_equal 'callback', func[:args][2][:name]
105161
assert_equal 'int (*)(const char *, void *)', func[:args][2][:type]
106162
assert_equal 'Function which will be called for every listed ref', func[:args][2][:comment]
107-
assert_equal 8, func[:comments].split("\n").size
163+
expect_comment =<<-EOF
164+
<p>The listed references may be filtered by type, or using a bitwise OR of several types. Use the magic value <code>GIT_REF_LISTALL</code> to obtain all references, including packed ones.</p>
165+
166+
<p>The <code>callback</code> function will be called for each of the references in the repository, and will receive the name of the reference and the <code>payload</code> value passed to this method.</p>
167+
EOF
168+
assert_equal expect_comment.split("\n").map(&:strip), func[:comments].split("\n")
108169
end
109170

110171
def test_can_get_the_full_description_from_multi_liners

test/fixtures/git2/common.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@
3939
# define GIT_END_DECL /* empty */
4040
#endif
4141

42+
/*
43+
* libclang won't consider anything with size_t to have comments unless we use
44+
* this hack.
45+
*/
46+
typedef size_t size_t;
47+
4248
/** Declare a public function exported for application use. */
4349
#ifdef __GNUC__
4450
# define GIT_EXTERN(type) extern \

test/parser_test.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_single_multiline_function
7070
*/
7171
int some_function(
7272
char *string,
73-
size_t len);
73+
int len);
7474
EOF
7575

7676
actual = parse(name, contents)
@@ -80,26 +80,26 @@ def test_single_multiline_function
8080
:tdef => nil,
8181
:type => :function,
8282
:name => 'some_function',
83-
:body => "int some_function(char *string, size_t len);",
83+
:body => "int some_function(char *string, int len);",
8484
:description => ' Do something',
8585
:comments => " More explanation of what we do\n\n ",
86-
:sig => 'char *::size_t',
86+
:sig => 'char *::int',
8787
:args => [{
8888
:name => 'string',
8989
:type => 'char *',
9090
:comment => 'a sequence of characters'
9191
},
9292
{
9393
:name => 'len',
94-
:type => 'size_t',
94+
:type => 'int',
9595
:comment => nil
9696
}],
9797
:return => {
9898
:type => 'int',
9999
:comment => ' an integer value'
100100
},
101-
:decl => "int some_function(char *string, size_t len)",
102-
:argline => "char *string, size_t len",
101+
:decl => "int some_function(char *string, int len)",
102+
:argline => "char *string, int len",
103103
}]
104104

105105
assert_equal expected, actual
@@ -192,7 +192,7 @@ def test_return_struct
192192
:argline => "git_tree *tree"
193193
}]
194194

195-
assert_equal actual, expected
195+
assert_equal expected, actual
196196

197197
end
198198

@@ -377,7 +377,7 @@ def test_type_reference
377377
:underlying_type => "int"
378378
}]
379379

380-
assert_equal actual, expected
380+
assert_equal expected, actual
381381

382382
name = 'typeref.h'
383383
contents = <<EOF
@@ -401,7 +401,7 @@ def test_type_reference
401401
:comments => '',
402402
}]
403403

404-
assert_equal actual, expected
404+
assert_equal expected, actual
405405

406406

407407
end

0 commit comments

Comments
 (0)