File tree Expand file tree Collapse file tree 2 files changed +22
-20
lines changed
src/main/java/org/truffleruby/interop Expand file tree Collapse file tree 2 files changed +22
-20
lines changed Original file line number Diff line number Diff line change 11
11
require_relative '../../ruby/spec_helper'
12
12
13
13
describe "Truffle::Interop" do
14
- it "has a method for each InteropLibrary message" do
15
- all_methods = Primitive . interop_library_all_methods
16
- all_methods -= %w[ getFactory getUncached ]
17
- expected = all_methods . map do |name |
18
- name = name . gsub ( /([a-z])([A-Z])/ ) { "#{ $1} _#{ $2. downcase } " }
19
- if name . start_with? ( 'is_' , 'has_' , 'fits_' )
20
- name += '?'
21
- end
22
- if name . start_with? ( 'is_' )
23
- name = name [ 3 ..-1 ]
24
- elsif name . start_with? ( 'get_' )
25
- name = name [ 4 ..-1 ]
26
- end
27
- name . to_sym
28
- end . sort
14
+ # Run locally and in TruffleRuby's CI but not in GraalVM's CI to not prevent adding new interop messages
15
+ guard -> { !ENV . key? ( 'BUILD_URL' ) or ENV . key? ( 'TRUFFLERUBY_CI' ) } do
16
+ it "has a method for each InteropLibrary message" do
17
+ all_methods = Primitive . interop_library_all_methods
18
+ expected = all_methods . map do |name |
19
+ name = name . gsub ( /([a-z])([A-Z])/ ) { "#{ $1} _#{ $2. downcase } " }
20
+ if name . start_with? ( 'is_' , 'has_' , 'fits_' )
21
+ name += '?'
22
+ end
23
+ if name . start_with? ( 'is_' )
24
+ name = name [ 3 ..-1 ]
25
+ elsif name . start_with? ( 'get_' )
26
+ name = name [ 4 ..-1 ]
27
+ end
28
+ name . to_sym
29
+ end . sort
29
30
30
- actual = Truffle ::Interop . methods . sort
31
+ actual = Truffle ::Interop . methods . sort
31
32
32
- # pp expected
33
- # pp actual
34
- ( expected - actual ) . should == [ ]
33
+ # pp expected
34
+ # pp actual
35
+ ( expected - actual ) . should == [ ]
36
+ end
35
37
end
36
38
end
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ protected RubyArray allMethodsOfInteropLibrary() {
123
123
private static String [] publicInteropLibraryMethods () {
124
124
List <String > methods = new ArrayList <>();
125
125
for (Method method : InteropLibrary .class .getDeclaredMethods ()) {
126
- if (Modifier .isPublic (method .getModifiers ())) {
126
+ if (Modifier .isPublic (method .getModifiers ()) && ! Modifier . isStatic ( method . getModifiers ()) ) {
127
127
if (!methods .contains (method .getName ())) {
128
128
methods .add (method .getName ());
129
129
}
You can’t perform that action at this time.
0 commit comments