Brought back the Standalone and Linker tests into backend.native:tests:run.

This commit is contained in:
Alexander Gorshenev
2018-01-19 12:56:21 +03:00
committed by alexander-gorshenev
parent 8c72f0a629
commit 33d895fcf7
3 changed files with 17 additions and 2 deletions
+5 -2
View File
@@ -146,7 +146,7 @@ def tasksOf(Closure<Task> 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"
@@ -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<String> 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<String> filesToCompile, String exe) {
@@ -564,6 +573,7 @@ class DynamicKonanTest extends KonanTest {
}
}
class RunExternalTestGroup extends RunStandaloneKonanTest {
def inDevelopersRun = false
def groupDirectory = "."
def outputSourceSetName = "testOutputExternal"
+2
View File
@@ -25,10 +25,12 @@ THREAD_LOCAL_VARIABLE long long storage;
extern "C" {
RUNTIME_USED
KDouble ReturnSlot_getDouble() {
return *reinterpret_cast<KDouble*>(&::storage);
}
RUNTIME_USED
void ReturnSlot_setDouble(KInt upper, KInt lower) {
reinterpret_cast<KInt*>(&::storage)[0] = lower;
reinterpret_cast<KInt*>(&::storage)[1] = upper;