From 5e54c29afbd8b7474cec05b8241af505c3a77ea4 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Fri, 3 Feb 2017 16:14:34 +0700 Subject: [PATCH] buildSrc: implement RunInteropKonanTest --- .../org/jetbrains/kotlin/KonanTest.groovy | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) 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