Move server process creation to JDK 6 suite
It's allow to avoid problem with wrong inherited output (gradle instead of test process)
This commit is contained in:
@@ -42,36 +42,12 @@ fun Project.codegenTest(target: Int, jvm: Int,
|
||||
codegenTest(target = 6, jvm = 6, jdk = "JDK_18") {
|
||||
dependsOn(testJvm6ServerRuntime)
|
||||
|
||||
val port = project.findProperty("kotlin.compiler.codegen.tests.port")?.toString() ?: "5100"
|
||||
var jdkProcess: Process? = null
|
||||
|
||||
doFirst {
|
||||
logger.info("Configuring JDK 6 server...")
|
||||
val jdkPath = project.findProperty("JDK_16") ?: error("JDK_16 is not optional to run this test")
|
||||
val executable = "$jdkPath/bin/java"
|
||||
val main = "org.jetbrains.kotlin.test.clientserver.TestProcessServer"
|
||||
val classpath = testJvm6ServerRuntime.asPath
|
||||
|
||||
logger.debug("Server classpath: $classpath")
|
||||
|
||||
val builder = ProcessBuilder(executable, "-cp", classpath, main, port)
|
||||
builder.directory(rootDir)
|
||||
|
||||
builder.inheritIO()
|
||||
builder.redirectErrorStream(true)
|
||||
|
||||
logger.info("Starting JDK 6 server $executable")
|
||||
jdkProcess = builder.start()
|
||||
|
||||
}
|
||||
systemProperty("kotlin.test.default.jvm.target", "1.6")
|
||||
systemProperty("kotlin.test.java.compilation.target", "1.6")
|
||||
systemProperty("kotlin.test.box.in.separate.process.port", port)
|
||||
|
||||
doLast {
|
||||
logger.info("Stopping JDK 6 server...")
|
||||
jdkProcess?.destroy()
|
||||
}
|
||||
val port = project.findProperty("kotlin.compiler.codegen.tests.port") ?: "5100"
|
||||
systemProperty("kotlin.test.box.in.separate.process.port", port)
|
||||
systemProperty("kotlin.test.box.in.separate.process.server.classpath", testJvm6ServerRuntime.asPath)
|
||||
}
|
||||
|
||||
codegenTest(target = 6, jvm = 9) {
|
||||
|
||||
Reference in New Issue
Block a user