ffi-clang 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +2 -0
- data/lib/ffi/clang/lib.rb +1 -3
- data/lib/ffi/clang/lib/translation_unit.rb +6 -0
- data/lib/ffi/clang/version.rb +1 -1
- data/spec/ffi/clang/cursor_spec.rb +1 -1
- data/spec/ffi/clang/index_spec.rb +16 -0
- data/spec/ffi/clang/token_spec.rb +1 -1
- data/spec/spec_helper.rb +8 -4
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9cc050343b09622e74559239ce649bbda2d777ec48ca34a694ec2e86ff7adb8d
|
4
|
+
data.tar.gz: c5a87040ba99b6adbeeaa4ce2db643a4dce996c127adbdfc7dc1a13d7f489279
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bbfe4335e44c46de7a97c8afa8fdc1fdb4008558dd7c46b5ece6db0275e0ce424910a49ff4edce9442887c048cc39f9305a982f55871a7c152f6eac254db5d5
|
7
|
+
data.tar.gz: c264998e24053cb04283313cbb2f07cbda23522e9c5e470c394db927e0ab99c677e9650abf17c9701a78775d277636454f664680e3fce0efd9bba9e1ef3d6f3b
|
data/.gitignore
CHANGED
data/lib/ffi/clang/lib.rb
CHANGED
@@ -37,6 +37,12 @@ module FFI
|
|
37
37
|
:cxx_chained_pch, 0x20,
|
38
38
|
:skip_function_bodies, 0x40,
|
39
39
|
:include_brief_comments_in_code_completion, 0x80,
|
40
|
+
:create_preamble_on_first_parse, 0x100,
|
41
|
+
:keep_going, 0x200,
|
42
|
+
:single_file_parse, 0x400,
|
43
|
+
:limit_skip_function_bodies_to_preamble, 0x800,
|
44
|
+
:include_attributed_type, 0x1000,
|
45
|
+
:visit_implicit_attributes, 0x2000
|
40
46
|
]
|
41
47
|
|
42
48
|
SaveTranslationUnitFlags = enum [
|
data/lib/ffi/clang/version.rb
CHANGED
@@ -49,6 +49,22 @@ describe Index do
|
|
49
49
|
it "can handle command line options" do
|
50
50
|
expect{index.parse_translation_unit(fixture_path("a.c"), ["-std=c++11"])}.not_to raise_error
|
51
51
|
end
|
52
|
+
|
53
|
+
it 'can handle translation unit options' do
|
54
|
+
expect{index.parse_translation_unit(fixture_path("a.c"), [], [], [:incomplete, :single_file_parse, :cache_completion_results])}.not_to raise_error
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'can handle missing translation options' do
|
58
|
+
expect{index.parse_translation_unit(fixture_path("a.c"), [], [], [])}.not_to raise_error
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'can handle translation options with random values' do
|
62
|
+
expect{index.parse_translation_unit(fixture_path("a.c"), [], [], {:incomplete => 654, :single_file_parse => 8, :cache_completion_results => 93})}.not_to raise_error
|
63
|
+
end
|
64
|
+
|
65
|
+
it "raises error when one of the translation options is invalid" do
|
66
|
+
expect{index.parse_translation_unit(fixture_path("a.c"), [], [], [:incomplete, :random_option, :cache_completion_results])}.to raise_error(FFI::Clang::Error)
|
67
|
+
end
|
52
68
|
end
|
53
69
|
|
54
70
|
describe '#create_translation_unit' do
|
@@ -26,7 +26,7 @@ describe Tokens do
|
|
26
26
|
|
27
27
|
it "can be obtained from a translation unit" do
|
28
28
|
expect(tokens).to be_kind_of(Tokens)
|
29
|
-
expect(tokens.size).to
|
29
|
+
expect(tokens.size).to be >= 12
|
30
30
|
expect(tokens.tokens).to be_kind_of(Array)
|
31
31
|
expect(tokens.tokens.first).to be_kind_of(Token)
|
32
32
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -29,19 +29,23 @@ module ClangSpecHelper
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
RSpec.configure do |
|
33
|
-
|
32
|
+
RSpec.configure do |config|
|
33
|
+
# Enable flags like --only-failures and --next-failure
|
34
|
+
config.example_status_persistence_file_path = ".rspec_status"
|
35
|
+
|
36
|
+
config.include ClangSpecHelper
|
37
|
+
|
34
38
|
supported_versions = ['3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '4.0']
|
35
39
|
current_version = ENV['LLVM_VERSION'] || supported_versions.last
|
36
40
|
supported_versions.reverse_each { |version|
|
37
41
|
break if version == current_version
|
38
42
|
sym = ('from_' + version.tr('.', '_')).to_sym
|
39
|
-
|
43
|
+
config.filter_run_excluding sym => true
|
40
44
|
}
|
41
45
|
|
42
46
|
supported_versions.each { |version|
|
43
47
|
break if version == current_version
|
44
48
|
sym = ('upto_' + version.tr('.', '_')).to_sym
|
45
|
-
|
49
|
+
config.filter_run_excluding sym => true
|
46
50
|
}
|
47
51
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffi-clang
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jari Bakken
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-03-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -164,8 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
- !ruby/object:Gem::Version
|
165
165
|
version: '0'
|
166
166
|
requirements: []
|
167
|
-
|
168
|
-
rubygems_version: 2.6.10
|
167
|
+
rubygems_version: 3.0.3
|
169
168
|
signing_key:
|
170
169
|
specification_version: 4
|
171
170
|
summary: Ruby FFI bindings for libclang C interface.
|