Hack to run tests on Linux.
This commit is contained in:
@@ -94,14 +94,23 @@ abstract class KonanTest extends DefaultTask {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String rdynamic() {
|
||||||
|
if (linux()) {
|
||||||
|
return "-rdynamic"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class UnitKonanTest extends KonanTest {
|
class UnitKonanTest extends KonanTest {
|
||||||
void compileTest(File sourceS, File runtimeS, File exe) {
|
void compileTest(File sourceS, File runtimeS, File exe) {
|
||||||
def testC = sourceS.absolutePath.replace(".kt.S", "-test.c")
|
def testC = sourceS.absolutePath.replace(".kt.S", "-test.c")
|
||||||
project.execClang {
|
project.execClang {
|
||||||
commandLine "clang", "${testC}", "${runtimeS.absolutePath}", "${sourceS.absolutePath}", "${mainC}", linkDl(),
|
commandLine "clang", "${testC}", "${runtimeS.absolutePath}", "${sourceS.absolutePath}", "${mainC}",
|
||||||
"-o", "${exe.absolutePath}"
|
"-o", "${exe.absolutePath}", linkDl(), rdynamic()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -109,8 +118,8 @@ class UnitKonanTest extends KonanTest {
|
|||||||
class RunKonanTest extends KonanTest {
|
class RunKonanTest extends KonanTest {
|
||||||
void compileTest(File sourceS, File runtimeS, File exe) {
|
void compileTest(File sourceS, File runtimeS, File exe) {
|
||||||
project.execClang {
|
project.execClang {
|
||||||
commandLine "clang", "-DRUN_TEST", "${runtimeS.absolutePath}", "${sourceS.absolutePath}", "${mainC}", linkDl(),
|
commandLine "clang", "-DRUN_TEST", "${runtimeS.absolutePath}", "${sourceS.absolutePath}", "${mainC}",
|
||||||
"-o", "${exe.absolutePath}"
|
"-o", "${exe.absolutePath}", linkDl(), rdynamic()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user