From ec936b72868e2687faaa3eb325d8392d90a37373 Mon Sep 17 00:00:00 2001 From: "simon.ogorodnik" Date: Thu, 20 Feb 2020 21:03:50 +0300 Subject: [PATCH] [FIR] Setup FIR tests configuration --- gradle/jps.gradle.kts | 45 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/gradle/jps.gradle.kts b/gradle/jps.gradle.kts index 31a8e3df009..42dfdc1bf91 100644 --- a/gradle/jps.gradle.kts +++ b/gradle/jps.gradle.kts @@ -14,11 +14,11 @@ val intellijUltimateEnabled: Boolean by rootProject.extra val ideaUltimatePluginDir: File by rootProject.extra val ideaUltimateSandboxDir: File by rootProject.extra -fun JUnit.configureForKotlin() { +fun JUnit.configureForKotlin(xmx: String = "1600m") { vmParameters = listOf( "-ea", "-XX:+HeapDumpOnOutOfMemoryError", - "-Xmx1600m", + "-Xmx$xmx", "-XX:+UseCodeCacheFlushing", "-XX:ReservedCodeCacheSize=128m", "-Djna.nosys=true", @@ -36,6 +36,44 @@ fun JUnit.configureForKotlin() { workingDirectory = rootDir.toString() } +// Needed because of idea.ext plugin doesn't allow to set TEST_SEARCH_SCOPE = moduleWithDependencies +fun setupFirRunConfiguration() { + + val junit = JUnit("_stub").apply { configureForKotlin("2048m") } + junit.moduleName = "kotlin.compiler.test" + junit.pattern = "^(org\\.jetbrains\\.kotlin\\.fir((?!\\.lightTree\\.benchmark)(\\.\\w+)*)\\.((?!(TreesCompareTest|TotalKotlinTest|RawFirBuilderTotalKotlinTestCase))\\w+)|org\\.jetbrains\\.kotlin\\.codegen\\.ir\\.FirBlackBoxCodegenTestGenerated)\$" + junit.vmParameters = junit.vmParameters.replace(rootDir.absolutePath, "\$PROJECT_DIR\$") + junit.workingDirectory = junit.workingDirectory.replace(rootDir.absolutePath, "\$PROJECT_DIR\$") + + rootDir.resolve(".idea/runConfigurations/JPS__Fast_FIR_tests.xml").writeText( + """ + | + | + | + | + | + ${junit.envs.entries.joinToString("\n") { (name, value) -> "| " }} + | + | + | + | + | + | + | + | + """.trimMargin() + ) +} + if (kotlinBuildProperties.isInJpsBuildIdeaSync) { allprojects { apply(mapOf("plugin" to "idea")) @@ -62,6 +100,9 @@ if (kotlinBuildProperties.isInJpsBuildIdeaSync) { } rootProject.afterEvaluate { + + setupFirRunConfiguration() + rootProject.allprojects { idea { module {