Add headless mode for tests to avoid graphic card switch

This commit is contained in:
Nikolay Krasko
2019-11-25 14:20:03 +03:00
parent 54338686d4
commit a9baec4727
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -100,6 +100,7 @@ fun Project.projectTest(
maxHeapSize = "1600m"
systemProperty("idea.is.unit.test", "true")
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
systemProperty("java.awt.headless", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
environment("PROJECT_CLASSES_DIRS", testSourceSet.output.classesDirs.asPath)
environment("PROJECT_BUILD_DIR", buildDir)
+3 -2
View File
@@ -1,7 +1,7 @@
@file:Suppress("UnstableApiUsage")
import org.jetbrains.gradle.ext.*
import org.gradle.jvm.tasks.Jar
import org.jetbrains.gradle.ext.*
import org.jetbrains.kotlin.ideaExt.*
@@ -26,7 +26,8 @@ fun JUnit.configureForKotlin() {
"-Didea.home.path=$ideaSdkPath",
"-Djps.kotlin.home=${ideaPluginDir.absolutePath}",
"-Dkotlin.ni=" + if (rootProject.hasProperty("newInferenceTests")) "true" else "false",
"-Duse.jps=true"
"-Duse.jps=true",
"-Djava.awt.headless=true"
).joinToString(" ")
envs = mapOf(
"NO_FS_ROOTS_ACCESS_CHECK" to "true",