JPS: fix SimpleKotlinJpsBuildTest.testDaemon

Make it the same as testJpsDaemonIC

Original commit: ab2b4311fd
This commit is contained in:
Sergey Rostov
2018-11-26 14:31:10 +03:00
parent 3fe93760ee
commit 5e68ef4676
@@ -16,8 +16,10 @@
package org.jetbrains.kotlin.jps.build package org.jetbrains.kotlin.jps.build
import com.intellij.openapi.util.io.FileUtil
import com.intellij.util.PathUtil import com.intellij.util.PathUtil
import org.jetbrains.jps.model.java.JpsJavaExtensionService import org.jetbrains.jps.model.java.JpsJavaExtensionService
import org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner
import org.jetbrains.kotlin.daemon.common.* import org.jetbrains.kotlin.daemon.common.*
import org.jetbrains.kotlin.test.KotlinTestUtils import org.jetbrains.kotlin.test.KotlinTestUtils
import java.io.File import java.io.File
@@ -66,22 +68,16 @@ class SimpleKotlinJpsBuildTest : AbstractKotlinJpsBuildTestCase() {
// TODO: add JS tests // TODO: add JS tests
fun testDaemon() { fun testDaemon() {
System.setProperty(COMPILE_DAEMON_ENABLED_PROPERTY, "") val daemonHome = FileUtil.createTempDirectory("daemon-home", "testJpsDaemonIC")
System.setProperty(COMPILE_DAEMON_VERBOSE_REPORT_PROPERTY, "")
// spaces in the name to test proper file name handling withSystemProperty(COMPILE_DAEMON_CUSTOM_RUN_FILES_PATH_FOR_TESTS, daemonHome.absolutePath) {
val flagFile = File.createTempFile("kotlin-jps - tests-", "-is-running") withSystemProperty(COMPILE_DAEMON_ENABLED_PROPERTY, "true") {
val logFile = File.createTempFile("kotlin-daemon", ".log") withSystemProperty(COMPILE_DAEMON_VERBOSE_REPORT_PROPERTY, "true") {
System.setProperty(COMPILE_DAEMON_CLIENT_ALIVE_PATH_PROPERTY, flagFile.absolutePath) withSystemProperty(JpsKotlinCompilerRunner.FAIL_ON_FALLBACK_PROPERTY, "true") {
System.setProperty(COMPILE_DAEMON_LOG_PATH_PROPERTY, logFile.loggerCompatiblePath) testLoadingKotlinFromDifferentModules()
try { }
testLoadingKotlinFromDifferentModules() }
} }
finally {
flagFile.delete()
System.clearProperty(COMPILE_DAEMON_LOG_PATH_PROPERTY)
System.clearProperty(COMPILE_DAEMON_CLIENT_ALIVE_PATH_PROPERTY)
System.clearProperty(COMPILE_DAEMON_VERBOSE_REPORT_PROPERTY)
System.clearProperty(COMPILE_DAEMON_ENABLED_PROPERTY)
} }
} }
} }