backend/tests: add more interop tests
This commit is contained in:
committed by
SvyatoslavScherbina
parent
59f65e9b3f
commit
19dbdf3137
@@ -1081,6 +1081,18 @@ kotlinNativeInterop {
|
|||||||
headers 'sys/stat.h'
|
headers 'sys/stat.h'
|
||||||
target 'native'
|
target 'native'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cstdlib {
|
||||||
|
pkg 'cstdlib'
|
||||||
|
headers 'stdlib.h'
|
||||||
|
target 'native'
|
||||||
|
}
|
||||||
|
|
||||||
|
cstdio {
|
||||||
|
defFile 'interop/basics/cstdio.def'
|
||||||
|
target 'native'
|
||||||
|
compilerOpts '-D_POSIX_SOURCE' // Exclude Darwin extensions causing link errors.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task interop0(type: RunInteropKonanTest) {
|
task interop0(type: RunInteropKonanTest) {
|
||||||
@@ -1088,3 +1100,15 @@ task interop0(type: RunInteropKonanTest) {
|
|||||||
source = "interop/basics/0.kt"
|
source = "interop/basics/0.kt"
|
||||||
interop = 'sysstat'
|
interop = 'sysstat'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task interop1(type: RunInteropKonanTest) {
|
||||||
|
goldValue = "257\n"
|
||||||
|
source = "interop/basics/1.kt"
|
||||||
|
interop = 'cstdlib'
|
||||||
|
}
|
||||||
|
|
||||||
|
task interop2(type: RunInteropKonanTest) {
|
||||||
|
goldValue = "Hello\n"
|
||||||
|
source = "interop/basics/2.kt"
|
||||||
|
interop = 'cstdio'
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import cstdlib.*
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
println(atoi("257"))
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import cstdio.*
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
puts("Hello")
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
headers = stdio.h
|
||||||
|
excludedFunctions = _IO_flockfile _IO_funlockfile _IO_ftrylockfile _IO_cleanup_region_start _IO_cleanup_region_end
|
||||||
Reference in New Issue
Block a user