diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index b29a15876b7..3b310e10124 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -146,7 +146,7 @@ def tasksOf(Closure filter) { } run { - def tasks = tasksOf { it instanceof RunKonanTest && !(it instanceof RunStdlibTest) } + def tasks = tasksOf { it instanceof KonanTest && it.inDevelopersRun } dependsOn(tasks) } @@ -2419,10 +2419,13 @@ if (isMac()) { task jsinterop_math(type: RunStandaloneKonanTest) { doFirst { + def jsinteropScript = isWindows() ? "jsinterop.bat" : "jsinterop" + def jsinterop = "$distDir/bin/$jsinteropScript" // TODO: We probably need a NativeInteropPlugin for jsinterop? - "jsinterop -pkg kotlinx.interop.wasm.math -o $buildDir/jsmath -target wasm32".execute() + "$jsinterop -pkg kotlinx.interop.wasm.math -o $buildDir/jsmath -target wasm32".execute().waitFor() } + dependsOn ':wasm32PlatformLibs' disabled = (project.testTarget != 'wasm32') goldValue = "e = 2.718281828459045, pi = 3.141592653589793, sin(pi) = 1.2246467991473532E-16, sin(pi/2) = 1.0, ln(1) = 0.0, ln(e) = 1.0\n" source = "jsinterop/math.kt" diff --git a/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy b/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy index d9ea1ecd248..d9045a0e19f 100644 --- a/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy +++ b/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy @@ -28,6 +28,8 @@ import javax.inject.Inject import java.util.regex.Pattern abstract class KonanTest extends JavaExec { + public boolean inDevelopersRun = false + public String source def targetManager = new TargetManager(project.testTarget) def target = targetManager.target @@ -390,6 +392,8 @@ class BuildKonanTest extends ExtKonanTest { * Runs test built with Konan's TestRunner */ class RunKonanTest extends ExtKonanTest { + public def inDevelopersRun = true + public def buildTaskName = 'buildKonanTests' public def runnerLogger = Logger.SILENT public def useFilter = true @@ -437,6 +441,7 @@ class RunKonanTest extends ExtKonanTest { } class RunStdlibTest extends RunKonanTest { + public def inDevelopersRun = false RunStdlibTest() { super('buildKonanStdlibTests') @@ -447,6 +452,8 @@ class RunStdlibTest extends RunKonanTest { * Compiles and executes test as a standalone binary */ class RunStandaloneKonanTest extends KonanTest { + public def inDevelopersRun = true + void compileTest(List filesToCompile, String exe) { runCompiler(filesToCompile, exe, flags?:[]) } @@ -521,6 +528,8 @@ class RunInteropKonanTest extends KonanTest { } class LinkKonanTest extends KonanTest { + public def inDevelopersRun = true + protected String lib void compileTest(List filesToCompile, String exe) { @@ -564,6 +573,7 @@ class DynamicKonanTest extends KonanTest { } } class RunExternalTestGroup extends RunStandaloneKonanTest { + def inDevelopersRun = false def groupDirectory = "." def outputSourceSetName = "testOutputExternal" diff --git a/runtime/src/main/cpp/ReturnSlot.cpp b/runtime/src/main/cpp/ReturnSlot.cpp index ef47a2cbf95..2c5ac47787e 100644 --- a/runtime/src/main/cpp/ReturnSlot.cpp +++ b/runtime/src/main/cpp/ReturnSlot.cpp @@ -25,10 +25,12 @@ THREAD_LOCAL_VARIABLE long long storage; extern "C" { +RUNTIME_USED KDouble ReturnSlot_getDouble() { return *reinterpret_cast(&::storage); } +RUNTIME_USED void ReturnSlot_setDouble(KInt upper, KInt lower) { reinterpret_cast(&::storage)[0] = lower; reinterpret_cast(&::storage)[1] = upper;