ffi-clang 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f3fba953ec692d348f92786e6892450d93011103
4
- data.tar.gz: 4e1b34caa60d2d0a577471d419170f998e1d5451
2
+ SHA256:
3
+ metadata.gz: 9cc050343b09622e74559239ce649bbda2d777ec48ca34a694ec2e86ff7adb8d
4
+ data.tar.gz: c5a87040ba99b6adbeeaa4ce2db643a4dce996c127adbdfc7dc1a13d7f489279
5
5
  SHA512:
6
- metadata.gz: b90f7d9d97dca48869b045e76c3f1c57e6efc390a67c0a07cb95527a85c735f70f22cbf76e9a0745a3233fa9cc388c42efdb1ec0c042583c413335801f376132
7
- data.tar.gz: ea69e1a70cb738ae85cbfd86a5de317724054926cdbc2e2bab50aa154497d53104ead7af30d7afb8e84c750f5e40952b2cde388b19f63621c48e2b975adb8239
6
+ metadata.gz: 0bbfe4335e44c46de7a97c8afa8fdc1fdb4008558dd7c46b5ece6db0275e0ce424910a49ff4edce9442887c048cc39f9305a982f55871a7c152f6eac254db5d5
7
+ data.tar.gz: c264998e24053cb04283313cbb2f07cbda23522e9c5e470c394db927e0ab99c677e9650abf17c9701a78775d277636454f664680e3fce0efd9bba9e1ef3d6f3b
data/.gitignore CHANGED
@@ -15,3 +15,5 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+
19
+ .rspec_status
@@ -61,9 +61,7 @@ module FFI
61
61
  def self.bitmask_from(enum, opts)
62
62
  bitmask = 0
63
63
 
64
- opts.each do |key, val|
65
- next unless val
66
-
64
+ opts.each do |key, value|
67
65
  if int = enum[key]
68
66
  bitmask |= int
69
67
  else
@@ -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 [
@@ -21,6 +21,6 @@
21
21
 
22
22
  module FFI
23
23
  module Clang
24
- VERSION = "0.5.0"
24
+ VERSION = "0.6.0"
25
25
  end
26
26
  end
@@ -31,7 +31,7 @@ describe "Function Call Cursors" do
31
31
  end
32
32
 
33
33
  it "should find a method call" do
34
- call.should_not be_nil
34
+ expect(call).to_not be_nil
35
35
  end
36
36
  end
37
37
 
@@ -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 eq(13)
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
@@ -29,19 +29,23 @@ module ClangSpecHelper
29
29
  end
30
30
  end
31
31
 
32
- RSpec.configure do |c|
33
- c.include ClangSpecHelper
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
- c.filter_run_excluding sym => true
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
- c.filter_run_excluding sym => true
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.5.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: 2017-03-14 00:00:00.000000000 Z
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
- rubyforge_project:
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.