[Test] Migrate :tests-different-jdk on runners which are using JUnit5

This commit is contained in:
Dmitriy Novozhilov
2021-01-28 11:08:14 +03:00
parent c969a34644
commit a4e9ab90a0
7 changed files with 172 additions and 147 deletions
+16 -2
View File
@@ -9,7 +9,20 @@ val testJvm6ServerRuntime by configurations.creating
dependencies {
testCompile(projectTests(":compiler"))
testApi(projectTests(":compiler:test-infrastructure"))
testApi(projectTests(":compiler:test-infrastructure-utils"))
testApi(projectTests(":compiler:tests-compiler-utils"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(projectTests(":compiler:tests-common-new"))
testApi(platform("org.junit:junit-bom:5.7.0"))
testApi("org.junit.jupiter:junit-jupiter")
testApi("org.junit.vintage:junit-vintage-engine:5.7.0")
testApi("org.junit.platform:junit-platform-commons:1.7.0")
testApi("org.junit.platform:junit-platform-launcher:1.7.0")
testApi("org.junit.platform:junit-platform-runner:1.7.0")
testApi("org.junit.platform:junit-platform-suite-api:1.7.0")
testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") }
testRuntime(project(":kotlin-reflect"))
testRuntime(intellijDep())
@@ -34,11 +47,12 @@ fun Project.codegenTest(
target: Int, jvm: String, jdk: String,
targetInTestClass: String = "$target",
body: Test.() -> Unit
): TaskProvider<Test> = projectTest("codegenTarget${targetInTestClass}Jvm${jvm}Test") {
): TaskProvider<Test> = projectTest("codegenTarget${targetInTestClass}Jvm${jvm}Test", jUnit5Enabled = true) {
dependsOn(":dist")
workingDir = rootDir
filter.includeTestsMatching("org.jetbrains.kotlin.codegen.jdk.JvmTarget${targetInTestClass}OnJvm${jvm}")
val testName = "JvmTarget${targetInTestClass}OnJvm${jvm}"
filter.includeTestsMatching("org.jetbrains.kotlin.codegen.jdk.$testName")
systemProperty("kotlin.test.default.jvm.target", "${if (target <= 8) "1." else ""}$target")
body()