diff --git a/compiler/fir/fir2ir/build.gradle.kts b/compiler/fir/fir2ir/build.gradle.kts index df30ec3e8b2..7a2d8f29cb3 100644 --- a/compiler/fir/fir2ir/build.gradle.kts +++ b/compiler/fir/fir2ir/build.gradle.kts @@ -21,16 +21,24 @@ dependencies { testRuntimeOnly(intellijDep()) - testApi(commonDep("junit:junit")) testCompileOnly(project(":kotlin-test:kotlin-test-jvm")) testCompileOnly(project(":kotlin-test:kotlin-test-junit")) - testApi(projectTests(":compiler:tests-common")) - testApi(projectTests(":compiler:fir:analysis-tests:legacy-fir-tests")) - testApi(project(":compiler:resolution.common")) + testApi(projectTests(":compiler:test-infrastructure")) + testApi(projectTests(":compiler:test-infrastructure-utils")) + testApi(projectTests(":compiler:tests-compiler-utils")) + testApi(projectTests(":compiler:tests-common-new")) + testApi(projectTests(":compiler:fir:analysis-tests")) + testApi(project(":compiler:fir:fir-serialization")) + + testApi(platform("org.junit:junit-bom:5.7.0")) + testApi("org.junit.jupiter:junit-jupiter") + testApi("org.junit.platform:junit-platform-commons:1.7.0") + testApi("org.junit.platform:junit-platform-launcher:1.7.0") testCompileOnly(project(":kotlin-reflect-api")) testRuntimeOnly(project(":kotlin-reflect")) testRuntimeOnly(project(":core:descriptors.runtime")) + testRuntimeOnly(project(":compiler:fir:fir2ir:jvm-backend")) testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") } @@ -53,8 +61,9 @@ if (kotlinBuildProperties.isInJpsBuildIdeaSync) { } } -projectTest(parallel = true) { +projectTest(parallel = true, jUnit5Enabled = true) { workingDir = rootDir + useJUnitPlatform() } testsJar() diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java similarity index 100% rename from compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java rename to compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxInlineCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxInlineCodegenTestGenerated.java similarity index 100% rename from compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxInlineCodegenTestGenerated.java rename to compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxInlineCodegenTestGenerated.java diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBytecodeTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBytecodeTextTestGenerated.java similarity index 100% rename from compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBytecodeTextTestGenerated.java rename to compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBytecodeTextTestGenerated.java diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java similarity index 100% rename from compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java rename to compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java diff --git a/compiler/tests-different-jdk/tests/org/jetbrains/kotlin/codegen/jdk/CustomJvmTargetOnJvmBaseTest.kt b/compiler/tests-different-jdk/tests/org/jetbrains/kotlin/codegen/jdk/CustomJvmTargetOnJvmBaseTest.kt index 1392c59982b..54f80ba0cdc 100644 --- a/compiler/tests-different-jdk/tests/org/jetbrains/kotlin/codegen/jdk/CustomJvmTargetOnJvmBaseTest.kt +++ b/compiler/tests-different-jdk/tests/org/jetbrains/kotlin/codegen/jdk/CustomJvmTargetOnJvmBaseTest.kt @@ -27,7 +27,6 @@ import org.junit.runner.RunWith CompileKotlinAgainstInlineKotlinTestGenerated::class ) @IncludeClassNamePatterns(".*Test.*Generated") -@Execution(ExecutionMode.SAME_THREAD) @UseTechnicalNames abstract class CustomJvmTargetOnJvmBaseTest diff --git a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt index 318a92a058c..7433d92c443 100644 --- a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt +++ b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt @@ -122,7 +122,9 @@ fun generateJUnit5CompilerTests(args: Array) { model("diagnostics/tests", excludedPattern = excludedFirTestdataPattern) model("diagnostics/testsWithStdLib", excludedPattern = excludedFirTestdataPattern) } + } + testGroup(testsRoot = "compiler/fir/fir2ir/tests-gen", testDataRoot = "compiler/testData") { testClass { model("codegen/box", excludeDirs = listOf("oldLanguageVersions")) model("codegen/boxAgainstJava", excludeDirs = listOf("oldLanguageVersions")) @@ -147,7 +149,7 @@ fun generateJUnit5CompilerTests(args: Array) { } } - testGroup(testsRoot = "compiler/fir/analysis-tests/tests-gen", testDataRoot = "compiler/testData") { + testGroup(testsRoot = "compiler/fir/fir2ir/tests-gen", testDataRoot = "compiler/testData") { testClass { model("ir/irText") } diff --git a/gradle/jps.gradle.kts b/gradle/jps.gradle.kts index 7b6c38acc4d..07494f9c62e 100644 --- a/gradle/jps.gradle.kts +++ b/gradle/jps.gradle.kts @@ -63,18 +63,9 @@ fun setupGenerateAllTestsRunConfiguration() { // Needed because of idea.ext plugin doesn't allow to set TEST_SEARCH_SCOPE = moduleWithDependencies fun setupFirRunConfiguration() { - val tests = listOf( - "org\\.jetbrains\\.kotlin\\.test\\.runners\\.FirDiagnosticsWithLightTreeTestGenerated", - "org\\.jetbrains\\.kotlin\\.test\\.runners\\.FirDiagnosticTestGenerated", - "org\\.jetbrains\\.kotlin\\.test\\.runners\\.FirDiagnosticTestSpecGenerated", - "org\\.jetbrains\\.kotlin\\.test\\.runners\\.FirOldFrontendDiagnosticsTestGenerated", - "org\\.jetbrains\\.kotlin\\.test\\.runners\\.ir\\.Fir2IrTextTestGenerated", - "org\\.jetbrains\\.kotlin\\.test\\.runners\\.codegen\\.FirBlackBoxCodegenTestGenerated" - ) - val junit = JUnit("_stub").apply { configureForKotlin("2048m") } - junit.moduleName = "kotlin.compiler.fir.analysis-tests.test" - junit.pattern = tests.joinToString(separator = "|", prefix = "^(", postfix = ")\$") + junit.moduleName = "kotlin.compiler.fir.fir2ir.test" + junit.pattern = """^.*\.Fir\w+TestGenerated$""" junit.vmParameters = junit.vmParameters.replace(rootDir.absolutePath, "\$PROJECT_DIR\$") junit.workingDirectory = junit.workingDirectory.replace(rootDir.absolutePath, "\$PROJECT_DIR\$")