Skip to content

Commit fce20bf

Browse files
committed
[[ Travis ]] Don't run java FFI tests on Travis
Since the Travis Trusty images were changed on 21/06/17, lc-run segfaults on them when binding to foreign java handlers. Stop running these tests until we can figure out the issue. The bug itself is reported as 19934.
1 parent c49afee commit fce20bf

2 files changed

Lines changed: 123 additions & 12 deletions

File tree

tests/lcb/stdlib/java.lcb

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ public handler TestCreateJObject()
2929
return
3030
end if
3131

32+
if the operating system is "linux" then
33+
skip test "java object creation succeeds" because "bug 19934"
34+
return
35+
end if
36+
3237
variable tObj as JObject
3338
unsafe
3439
put CreateJavaObject() into tObj
@@ -47,6 +52,11 @@ public handler TestCreateJString()
4752
skip test "java string creation succeeds" because "not implemented on" && the operating system
4853
return
4954
end if
55+
56+
if the operating system is "linux" then
57+
skip test "java string creation succeeds" because "bug 19934"
58+
return
59+
end if
5060

5161
plan 1 tests
5262

@@ -76,6 +86,11 @@ public handler TestRoundTripJString()
7686
skip test "string round trips through java" because "not implemented on" && the operating system
7787
return
7888
end if
89+
90+
if the operating system is "linux" then
91+
skip test "string round trips through java" because "bug 19934"
92+
return
93+
end if
7994

8095
variable tString as String
8196
put "lcb string" into tString
@@ -96,6 +111,12 @@ public handler TestRoundTripJByteArray()
96111
return
97112
end if
98113

114+
if the operating system is "linux" then
115+
skip test "data round trips through java" because "bug 19934"
116+
return
117+
end if
118+
119+
99120
variable tData as Data
100121
put 20 random bytes into tData
101122

@@ -112,6 +133,16 @@ end handler
112133
foreign handler GetJavaPi() returns CDouble binds to "java:java.lang.Math>get.PI()D!static"
113134

114135
public handler TestGetConstant()
136+
if not the operating system is in ["mac", "linux"] then
137+
skip test "get java class constant" because "not implemented on" && the operating system
138+
return
139+
end if
140+
141+
if the operating system is "linux" then
142+
skip test "get java class constant" because "bug 19934"
143+
return
144+
end if
145+
115146
variable tPiTrunc as Number
116147
unsafe
117148
put the trunc of GetJavaPi() into tPiTrunc
@@ -123,6 +154,16 @@ end handler
123154
foreign handler CallJavaAdd(in pLeft as JLong, in pRight as JLong) returns JLong binds to "java:java.lang.Math>addExact(JJ)J!static"
124155

125156
public handler TestCallStaticMethod()
157+
if not the operating system is in ["mac", "linux"] then
158+
skip test "call java class static method" because "not implemented on" && the operating system
159+
return
160+
end if
161+
162+
if the operating system is "linux" then
163+
skip test "call java class static method" because "bug 19934"
164+
return
165+
end if
166+
126167
variable tLeft as Number
127168
variable tRight as Number
128169
put 1 into tLeft
@@ -138,6 +179,16 @@ end handler
138179
foreign handler JavaStringIsEmpty(in pString as JString) returns JBoolean binds to "java:java.lang.String>isEmpty()Z"
139180

140181
public handler TestCallInstanceMethod()
182+
if not the operating system is in ["mac", "linux"] then
183+
skip test "call java class instance method" because "not implemented on" && the operating system
184+
return
185+
end if
186+
187+
if the operating system is "linux" then
188+
skip test "call java class instance method" because "bug 19934"
189+
return
190+
end if
191+
141192
variable tJavaString as JString
142193
put StringToJString("nonempty") into tJavaString
143194

@@ -152,6 +203,16 @@ foreign handler JavaGetDefaultLocale() returns JObject binds to "java:java.util.
152203
foreign handler JavaLocaleDisplayName(in pLocale as JObject) returns JObject binds to "java:java.util.Locale>getDisplayName()Ljava/lang/String;"
153204

154205
public handler TestDefaultLocaleDisplayName()
206+
if not the operating system is in ["mac", "linux"] then
207+
skip test "get locale display name" because "not implemented on" && the operating system
208+
return
209+
end if
210+
211+
if the operating system is "linux" then
212+
skip test "get locale display name" because "bug 19934"
213+
return
214+
end if
215+
155216
variable tDisplay as JString
156217
unsafe
157218
variable tLocale as JObject
@@ -166,6 +227,16 @@ end handler
166227
foreign handler CreateJavaCurrencyWithCode(in pString as JString) returns JObject binds to "java:java.util.Currency>getInstance(Ljava/lang/String;)Ljava/util/Currency;!static"
167228

168229
public handler TestCreateCurrencyWithCode()
230+
if not the operating system is in ["mac", "linux"] then
231+
skip test "currency created" because "not implemented on" && the operating system
232+
return
233+
end if
234+
235+
if the operating system is "linux" then
236+
skip test "currency created" because "bug 19934"
237+
return
238+
end if
239+
169240
-- Create a new Currency object
170241
variable tCurrency as JObject
171242
unsafe
@@ -206,6 +277,16 @@ public handler NullIntoJObject()
206277
end handler
207278

208279
public handler TestNullJObjectReturn()
280+
if not the operating system is in ["mac", "linux"] then
281+
skip test "NULL into optional JObject" because "not implemented on" && the operating system
282+
return
283+
end if
284+
285+
if the operating system is "linux" then
286+
skip test "NULL into optional JObject" because "bug 19934"
287+
return
288+
end if
289+
209290
MCUnitTestHandlerDoesntThrow(NullIntoOptionalJObject, "no error when putting NULL into optional JObject")
210291
MCUnitTestHandlerThrows(NullIntoJObject, "type mismatch when putting NULL into non-optional JObject")
211292
end handler
@@ -229,13 +310,33 @@ public handler NullParamJObject()
229310
end handler
230311

231312
public handler TestNullJObjectParam()
313+
if not the operating system is in ["mac", "linux"] then
314+
skip test "NULL passed as optional JObject" because "not implemented on" && the operating system
315+
return
316+
end if
317+
318+
if the operating system is "linux" then
319+
skip test "NULL passed as optional JObject" because "bug 19934"
320+
return
321+
end if
322+
232323
MCUnitTestHandlerDoesntThrow(NullParamOptionalJObject, "no error when passing NULL as optional JObject")
233324
MCUnitTestHandlerThrows(NullParamJObject, "type mismatch when passing NULL as non-optional JObject")
234325
end handler
235326

236327
foreign handler StringCodepointAt(in pSequence as JObject, in pIndex as JInt) returns JInt binds to "java:java.lang.Character>codePointAt(Ljava/lang/CharSequence;I)I!static"
237328

238329
public handler TestNativeTypeAfterObjectType()
330+
if not the operating system is in ["mac", "linux"] then
331+
skip test "called foreign handler with signature Ljava/lang/CharSequence;I" because "not implemented on" && the operating system
332+
return
333+
end if
334+
335+
if the operating system is "linux" then
336+
skip test "called foreign handler with signature Ljava/lang/CharSequence;I" because "bug 19934"
337+
return
338+
end if
339+
239340
unsafe
240341
variable tCodepoint as Integer
241342
put StringCodepointAt(StringToJString("a"), 0) into tCodepoint

tests/lcb/vm/foreign-binding.lcb

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,50 +9,60 @@ use com.livecode.__INTERNAL._testlib
99
foreign handler SomeCFunctionWhichDoesNotExist() returns nothing binds to "<builtin>"
1010
foreign handler MCValueCopyDescription(in pValue as any, out rDesc as String) returns CBool binds to "<builtin>"
1111

12-
private handler TestForeignBinding_NonExistantC()
12+
private handler TestForeignBinding_NonExistentC()
1313
unsafe
1414
SomeCFunctionWhichDoesNotExist()
1515
end unsafe
1616
end handler
1717

18-
private handler TestForeignBinding_ExistantC()
18+
private handler TestForeignBinding_ExistentC()
1919
unsafe
2020
variable tString as String
2121
MCValueCopyDescription("", tString)
2222
end unsafe
2323
end handler
2424

2525
public handler TestForeignBinding_C()
26-
MCUnitTestHandlerThrowsNamed(TestForeignBinding_NonExistantC, "livecode.lang.ForeignHandlerBindingError", "Failure to bind to non-existant C function throws error")
27-
MCUnitTestHandlerDoesntThrow(TestForeignBinding_ExistantC, "Binding to existant C function does not throw error")
26+
MCUnitTestHandlerThrowsNamed(TestForeignBinding_NonExistentC, "livecode.lang.ForeignHandlerBindingError", "Failure to bind to non-existent C function throws error")
27+
MCUnitTestHandlerDoesntThrow(TestForeignBinding_ExistentC, "Binding to existent C function does not throw error")
2828

29-
test "Non-existant C function gives nothing as handler value" when SomeCFunctionWhichDoesNotExist is nothing
30-
test "Existant C function gives non-nothing as handler value" when MCValueCopyDescription is not nothing
29+
test "Non-existent C function gives nothing as handler value" when SomeCFunctionWhichDoesNotExist is nothing
30+
test "Existent C function gives non-nothing as handler value" when MCValueCopyDescription is not nothing
3131
end handler
3232

3333
---------
3434

3535
foreign handler CreateJavaObject() returns JObject binds to "java:java.lang.Object>new()"
3636
foreign handler CreateJavaObjectDoesntExist() returns JObject binds to "java:java.lang.Object>new_doesnt_exist()"
3737

38-
private handler TestForeignBinding_NonExistantJava()
38+
private handler TestForeignBinding_NonExistentJava()
3939
unsafe
4040
CreateJavaObjectDoesntExist()
4141
end unsafe
4242
end handler
4343

44-
private handler TestForeignBinding_ExistantJava()
44+
private handler TestForeignBinding_ExistentJava()
4545
unsafe
4646
CreateJavaObject()
4747
end unsafe
4848
end handler
4949

5050
public handler TestForeignBinding_Java()
51-
MCUnitTestHandlerThrowsNamed(TestForeignBinding_NonExistantJava, "livecode.lang.ForeignHandlerBindingError", "Failure to bind to non-existant java function throws error")
52-
MCUnitTestHandlerDoesntThrow(TestForeignBinding_ExistantJava, "Binding to existant java function does not throw error")
51+
if not the operating system is in ["mac", "linux"] then
52+
skip test "(Non)existent java function" because "not implemented on" && the operating system
53+
return
54+
end if
55+
56+
if the operating system is "linux" then
57+
skip test "(Non)existent java function" because "bug 19934"
58+
return
59+
end if
60+
61+
MCUnitTestHandlerThrowsNamed(TestForeignBinding_NonExistentJava, "livecode.lang.ForeignHandlerBindingError", "Failure to bind to non-existent java function throws error")
62+
MCUnitTestHandlerDoesntThrow(TestForeignBinding_ExistentJava, "Binding to existent java function does not throw error")
5363

54-
test "Non-existant java function gives nothing as handler value" when CreateJavaObjectDoesntExist is nothing
55-
test "Existant java function gives non-nothing as handler value" when CreateJavaObject is not nothing
64+
test "Non-existent java function gives nothing as handler value" when CreateJavaObjectDoesntExist is nothing
65+
test "Existent java function gives non-nothing as handler value" when CreateJavaObject is not nothing
5666
end handler
5767

5868
end module

0 commit comments

Comments
 (0)