tests: Support custom konan.home in backend tests
This commit is contained in:
@@ -29,7 +29,7 @@ abstract class KonanTest extends JavaExec {
|
|||||||
def target = targetManager.target
|
def target = targetManager.target
|
||||||
def backendNative = project.project(":backend.native")
|
def backendNative = project.project(":backend.native")
|
||||||
def runtimeProject = project.project(":runtime")
|
def runtimeProject = project.project(":runtime")
|
||||||
def dist = project.rootProject.file("dist")
|
def dist = project.rootProject.file(project.findProperty("konan.home") ?: "dist")
|
||||||
def dependenciesDir = project.rootProject.dependenciesDir
|
def dependenciesDir = project.rootProject.dependenciesDir
|
||||||
def konancDriver = project.isWindows() ? "konanc.bat" : "konanc"
|
def konancDriver = project.isWindows() ? "konanc.bat" : "konanc"
|
||||||
def konanc = new File("${dist.canonicalPath}/bin/$konancDriver").absolutePath
|
def konanc = new File("${dist.canonicalPath}/bin/$konancDriver").absolutePath
|
||||||
@@ -72,9 +72,10 @@ abstract class KonanTest extends JavaExec {
|
|||||||
}
|
}
|
||||||
|
|
||||||
KonanTest(){
|
KonanTest(){
|
||||||
// TODO: that's a long reach up the project tree.
|
// We don't build the compiler if a custom konan.home path is specified.
|
||||||
// May be we should reorganize a little.
|
if (!project.hasProperty("konan.home")) {
|
||||||
dependsOn(project.rootProject.tasks['dist'])
|
dependsOn(project.rootProject.tasks['dist'])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -90,7 +91,9 @@ abstract class KonanTest extends JavaExec {
|
|||||||
def log = new ByteArrayOutputStream()
|
def log = new ByteArrayOutputStream()
|
||||||
try {
|
try {
|
||||||
main = 'org.jetbrains.kotlin.cli.bc.K2NativeKt'
|
main = 'org.jetbrains.kotlin.cli.bc.K2NativeKt'
|
||||||
classpath = project.configurations.cli_bc
|
classpath = project.fileTree("$dist.canonicalPath/konan/lib/") {
|
||||||
|
include '*.jar'
|
||||||
|
}
|
||||||
jvmArgs "-Dkonan.home=${dist.canonicalPath}",
|
jvmArgs "-Dkonan.home=${dist.canonicalPath}",
|
||||||
"-Djava.library.path=${dist.canonicalPath}/konan/nativelib"
|
"-Djava.library.path=${dist.canonicalPath}/konan/nativelib"
|
||||||
enableAssertions = true
|
enableAssertions = true
|
||||||
@@ -419,7 +422,10 @@ class RunDriverKonanTest extends KonanTest {
|
|||||||
|
|
||||||
RunDriverKonanTest() {
|
RunDriverKonanTest() {
|
||||||
super()
|
super()
|
||||||
dependsOn(project.rootProject.tasks['cross_dist'])
|
// We don't build the compiler if a custom konan.home path is specified.
|
||||||
|
if (!project.hasProperty("konan.home")) {
|
||||||
|
dependsOn(project.rootProject.tasks['cross_dist'])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void compileTest(List<String> filesToCompile, String exe) {
|
void compileTest(List<String> filesToCompile, String exe) {
|
||||||
|
|||||||
Reference in New Issue
Block a user