buildSrc: implement RunInteropKonanTest

This commit is contained in:
Svyatoslav Scherbina
2017-02-03 16:14:34 +07:00
committed by SvyatoslavScherbina
parent 97cd2b4d5f
commit 5e54c29afb
@@ -158,6 +158,28 @@ class RunKonanTest extends KonanTest {
}
}
@ParallelizableTask
class RunInteropKonanTest extends KonanTest {
private String interop
private NamedNativeInteropConfig interopConf
void setInterop(String value) {
this.interop = value
this.interopConf = project.kotlinNativeInterop[value]
this.dependsOn(this.interopConf.genTask)
}
void compileTest(List<String> filesToCompile, String exe) {
String interopBc = exe + "-interop.bc"
runCompiler([interopConf.generatedSrcDir.absolutePath], interopBc, ["-nolink"])
String interopStubsBc = new File(interopConf.nativeLibsDir, interop + "stubs.bc").absolutePath
runCompiler(filesToCompile, exe, ["-library", interopBc, "-nativelibrary", interopStubsBc])
}
}
@ParallelizableTask
class LinkKonanTest extends KonanTest {
protected String lib