diff --git a/buildSrc/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy b/buildSrc/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy index f7d1cf8181b..b82d033d7c5 100644 --- a/buildSrc/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy +++ b/buildSrc/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy @@ -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 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