Extending daemon diagnostics reporting in tests
This commit is contained in:
@@ -39,11 +39,17 @@ public class CompilerDaemonTest : KotlinIntegrationTestBase() {
|
|||||||
File("dependencies/bootstrap-compiler/Kotlin/kotlinc/lib/kotlin-reflect.jar")) }
|
File("dependencies/bootstrap-compiler/Kotlin/kotlinc/lib/kotlin-reflect.jar")) }
|
||||||
|
|
||||||
private fun compileOnDaemon(args: Array<out String>): CompilerResults {
|
private fun compileOnDaemon(args: Array<out String>): CompilerResults {
|
||||||
val daemon = KotlinCompilerClient.connectToCompileService(compilerId, daemonJVMOptions, daemonOptions, DaemonReportingTargets(out = System.err), autostart = true, checkId = true)
|
System.setProperty(COMPILE_DAEMON_VERBOSE_REPORT_PROPERTY, "")
|
||||||
TestCase.assertNotNull("failed to connect daemon", daemon)
|
try {
|
||||||
val strm = ByteArrayOutputStream()
|
val daemon = KotlinCompilerClient.connectToCompileService(compilerId, daemonJVMOptions, daemonOptions, DaemonReportingTargets(out = System.err), autostart = true, checkId = true)
|
||||||
val code = KotlinCompilerClient.compile(daemon!!, args, strm)
|
TestCase.assertNotNull("failed to connect daemon", daemon)
|
||||||
return CompilerResults(code, strm.toString())
|
val strm = ByteArrayOutputStream()
|
||||||
|
val code = KotlinCompilerClient.compile(daemon!!, args, strm)
|
||||||
|
return CompilerResults(code, strm.toString())
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
System.clearProperty(COMPILE_DAEMON_VERBOSE_REPORT_PROPERTY)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun runDaemonCompilerTwice(logName: String, vararg arguments: String): Unit {
|
private fun runDaemonCompilerTwice(logName: String, vararg arguments: String): Unit {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.intellij.util.PathUtil
|
|||||||
import org.jetbrains.jps.model.java.JpsJavaExtensionService
|
import org.jetbrains.jps.model.java.JpsJavaExtensionService
|
||||||
import org.jetbrains.kotlin.rmi.COMPILE_DAEMON_CLIENT_ALIVE_PATH_PROPERTY
|
import org.jetbrains.kotlin.rmi.COMPILE_DAEMON_CLIENT_ALIVE_PATH_PROPERTY
|
||||||
import org.jetbrains.kotlin.rmi.COMPILE_DAEMON_ENABLED_PROPERTY
|
import org.jetbrains.kotlin.rmi.COMPILE_DAEMON_ENABLED_PROPERTY
|
||||||
|
import org.jetbrains.kotlin.rmi.COMPILE_DAEMON_VERBOSE_REPORT_PROPERTY
|
||||||
import org.jetbrains.kotlin.test.JetTestUtils
|
import org.jetbrains.kotlin.test.JetTestUtils
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
@@ -110,6 +111,7 @@ public class SimpleKotlinJpsBuildTest : AbstractKotlinJpsBuildTestCase() {
|
|||||||
|
|
||||||
public fun testThreeModulesNoReexportWithDaemon() {
|
public fun testThreeModulesNoReexportWithDaemon() {
|
||||||
System.setProperty(COMPILE_DAEMON_ENABLED_PROPERTY,"")
|
System.setProperty(COMPILE_DAEMON_ENABLED_PROPERTY,"")
|
||||||
|
System.setProperty(COMPILE_DAEMON_VERBOSE_REPORT_PROPERTY, "")
|
||||||
val flagFile = File.createTempFile("kotlin-jps-tests-", "-is-running");
|
val flagFile = File.createTempFile("kotlin-jps-tests-", "-is-running");
|
||||||
try {
|
try {
|
||||||
System.setProperty(COMPILE_DAEMON_CLIENT_ALIVE_PATH_PROPERTY, flagFile.absolutePath)
|
System.setProperty(COMPILE_DAEMON_CLIENT_ALIVE_PATH_PROPERTY, flagFile.absolutePath)
|
||||||
@@ -118,6 +120,7 @@ public class SimpleKotlinJpsBuildTest : AbstractKotlinJpsBuildTestCase() {
|
|||||||
finally {
|
finally {
|
||||||
flagFile.delete()
|
flagFile.delete()
|
||||||
System.clearProperty(COMPILE_DAEMON_CLIENT_ALIVE_PATH_PROPERTY)
|
System.clearProperty(COMPILE_DAEMON_CLIENT_ALIVE_PATH_PROPERTY)
|
||||||
|
System.clearProperty(COMPILE_DAEMON_VERBOSE_REPORT_PROPERTY)
|
||||||
System.clearProperty(COMPILE_DAEMON_ENABLED_PROPERTY)
|
System.clearProperty(COMPILE_DAEMON_ENABLED_PROPERTY)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user