Hack to run tests on Linux.

This commit is contained in:
Nikolay Igotti
2016-11-08 18:31:45 +03:00
parent 91035b692b
commit 00fdc90d43
+13 -4
View File
@@ -94,14 +94,23 @@ abstract class KonanTest extends DefaultTask {
return ""
}
}
protected String rdynamic() {
if (linux()) {
return "-rdynamic"
}
else {
return ""
}
}
}
class UnitKonanTest extends KonanTest {
void compileTest(File sourceS, File runtimeS, File exe) {
def testC = sourceS.absolutePath.replace(".kt.S", "-test.c")
project.execClang {
commandLine "clang", "${testC}", "${runtimeS.absolutePath}", "${sourceS.absolutePath}", "${mainC}", linkDl(),
"-o", "${exe.absolutePath}"
commandLine "clang", "${testC}", "${runtimeS.absolutePath}", "${sourceS.absolutePath}", "${mainC}",
"-o", "${exe.absolutePath}", linkDl(), rdynamic()
}
}
}
@@ -109,8 +118,8 @@ class UnitKonanTest extends KonanTest {
class RunKonanTest extends KonanTest {
void compileTest(File sourceS, File runtimeS, File exe) {
project.execClang {
commandLine "clang", "-DRUN_TEST", "${runtimeS.absolutePath}", "${sourceS.absolutePath}", "${mainC}", linkDl(),
"-o", "${exe.absolutePath}"
commandLine "clang", "-DRUN_TEST", "${runtimeS.absolutePath}", "${sourceS.absolutePath}", "${mainC}",
"-o", "${exe.absolutePath}", linkDl(), rdynamic()
}
}
}