Add headless mode for tests to avoid graphic card switch
This commit is contained in:
@@ -100,6 +100,7 @@ fun Project.projectTest(
|
|||||||
maxHeapSize = "1600m"
|
maxHeapSize = "1600m"
|
||||||
systemProperty("idea.is.unit.test", "true")
|
systemProperty("idea.is.unit.test", "true")
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
||||||
|
systemProperty("java.awt.headless", "true")
|
||||||
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
|
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
|
||||||
environment("PROJECT_CLASSES_DIRS", testSourceSet.output.classesDirs.asPath)
|
environment("PROJECT_CLASSES_DIRS", testSourceSet.output.classesDirs.asPath)
|
||||||
environment("PROJECT_BUILD_DIR", buildDir)
|
environment("PROJECT_BUILD_DIR", buildDir)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
@file:Suppress("UnstableApiUsage")
|
@file:Suppress("UnstableApiUsage")
|
||||||
|
|
||||||
import org.jetbrains.gradle.ext.*
|
|
||||||
import org.gradle.jvm.tasks.Jar
|
import org.gradle.jvm.tasks.Jar
|
||||||
|
import org.jetbrains.gradle.ext.*
|
||||||
import org.jetbrains.kotlin.ideaExt.*
|
import org.jetbrains.kotlin.ideaExt.*
|
||||||
|
|
||||||
|
|
||||||
@@ -26,7 +26,8 @@ fun JUnit.configureForKotlin() {
|
|||||||
"-Didea.home.path=$ideaSdkPath",
|
"-Didea.home.path=$ideaSdkPath",
|
||||||
"-Djps.kotlin.home=${ideaPluginDir.absolutePath}",
|
"-Djps.kotlin.home=${ideaPluginDir.absolutePath}",
|
||||||
"-Dkotlin.ni=" + if (rootProject.hasProperty("newInferenceTests")) "true" else "false",
|
"-Dkotlin.ni=" + if (rootProject.hasProperty("newInferenceTests")) "true" else "false",
|
||||||
"-Duse.jps=true"
|
"-Duse.jps=true",
|
||||||
|
"-Djava.awt.headless=true"
|
||||||
).joinToString(" ")
|
).joinToString(" ")
|
||||||
envs = mapOf(
|
envs = mapOf(
|
||||||
"NO_FS_ROOTS_ACCESS_CHECK" to "true",
|
"NO_FS_ROOTS_ACCESS_CHECK" to "true",
|
||||||
|
|||||||
Reference in New Issue
Block a user