Remove separate test configurations for JDK 21
^KT-58765 Now that JDK 21 was released as stable, we can remove separate test configurations for testing the compiler with JDK 21 and reintegrate the corresponding test data into standard test configurations.
This commit is contained in:
committed by
Space Team
parent
13b3987aab
commit
a5bae12915
@@ -62,37 +62,19 @@ if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
||||
}
|
||||
}
|
||||
|
||||
fun Test.configureTest(configureJUnit: JUnitPlatformOptions.() -> Unit = {}) {
|
||||
dependsOn(":dist")
|
||||
workingDir = rootDir
|
||||
useJUnitPlatform {
|
||||
configureJUnit()
|
||||
}
|
||||
useJsIrBoxTests(version = version, buildDir = layout.buildDirectory)
|
||||
}
|
||||
|
||||
|
||||
projectTest(
|
||||
jUnitMode = JUnitMode.JUnit5,
|
||||
defineJDKEnvVariables = listOf(JdkMajorVersion.JDK_1_8, JdkMajorVersion.JDK_11_0, JdkMajorVersion.JDK_17_0)
|
||||
) {
|
||||
configureTest {
|
||||
excludeTags("Jdk21Test")
|
||||
}
|
||||
}
|
||||
|
||||
// Separate configuration is only necessary while JDK 21 is not released, so cannot be obtained via toolchain.
|
||||
// See KT-58765 for tracking
|
||||
projectTest(
|
||||
"jdk21Tests",
|
||||
jUnitMode = JUnitMode.JUnit5,
|
||||
defineJDKEnvVariables = listOf(
|
||||
JdkMajorVersion.JDK_1_8,
|
||||
JdkMajorVersion.JDK_11_0,
|
||||
JdkMajorVersion.JDK_17_0,
|
||||
JdkMajorVersion.JDK_21_0
|
||||
)
|
||||
) {
|
||||
configureTest {
|
||||
includeTags("Jdk21Test")
|
||||
}
|
||||
dependsOn(":dist")
|
||||
workingDir = rootDir
|
||||
useJUnitPlatform()
|
||||
useJsIrBoxTests(version = version, buildDir = layout.buildDirectory)
|
||||
}
|
||||
|
||||
testsJar()
|
||||
|
||||
@@ -54,37 +54,15 @@ sourceSets {
|
||||
}
|
||||
}
|
||||
|
||||
fun Test.configureTest(configureJUnit: JUnitPlatformOptions.() -> Unit = {}) {
|
||||
dependsOn(":dist")
|
||||
workingDir = rootDir
|
||||
useJUnitPlatform {
|
||||
configureJUnit()
|
||||
}
|
||||
}
|
||||
|
||||
projectTest(
|
||||
jUnitMode = JUnitMode.JUnit5,
|
||||
defineJDKEnvVariables = listOf(
|
||||
JdkMajorVersion.JDK_11_0 // e.g. org.jetbrains.kotlin.test.runners.ForeignAnnotationsCompiledJavaTestGenerated.Java11Tests
|
||||
)
|
||||
) {
|
||||
configureTest {
|
||||
excludeTags("Jdk21Test")
|
||||
}
|
||||
}
|
||||
|
||||
// Separate configuration is only necessary while JDK 21 is not released, so cannot be obtained via toolchain.
|
||||
// See KT-58765 for tracking
|
||||
projectTest(
|
||||
"jdk21Tests",
|
||||
jUnitMode = JUnitMode.JUnit5,
|
||||
defineJDKEnvVariables = listOf(
|
||||
JdkMajorVersion.JDK_21_0
|
||||
)
|
||||
) {
|
||||
configureTest {
|
||||
includeTags("Jdk21Test")
|
||||
}
|
||||
dependsOn(":dist")
|
||||
workingDir = rootDir
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
testsJar()
|
||||
|
||||
+8
@@ -122,6 +122,14 @@ abstract class AbstractDiagnosticTest : AbstractKotlinCompilerTest() {
|
||||
}
|
||||
}
|
||||
|
||||
forTestsMatching("compiler/testData/diagnostics/tests/testsWithJava21/*") {
|
||||
defaultDirectives {
|
||||
JDK_KIND with TestJdkKind.FULL_JDK_21
|
||||
+WITH_STDLIB
|
||||
+WITH_REFLECT
|
||||
}
|
||||
}
|
||||
|
||||
forTestsMatching("compiler/testData/diagnostics/tests/multiplatform/*") {
|
||||
defaultDirectives {
|
||||
LANGUAGE with "+MultiPlatformProjects"
|
||||
|
||||
+8
-20
@@ -51,26 +51,6 @@ abstract class AbstractFirDiagnosticTestBase(val parser: FirParser) : AbstractKo
|
||||
}
|
||||
}
|
||||
|
||||
@Jdk21Test
|
||||
abstract class AbstractFirPsiJdk21DiagnosticTest : AbstractFirDiagnosticTestBase(FirParser.Psi) {
|
||||
override fun configure(builder: TestConfigurationBuilder) {
|
||||
super.configure(builder)
|
||||
builder.defaultDirectives {
|
||||
JDK_KIND with TestJdkKind.FULL_JDK_21
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Jdk21Test
|
||||
abstract class AbstractFirLightTreeJdk21DiagnosticTest : AbstractFirDiagnosticTestBase(FirParser.LightTree) {
|
||||
override fun configure(builder: TestConfigurationBuilder) {
|
||||
super.configure(builder)
|
||||
builder.defaultDirectives {
|
||||
JDK_KIND with TestJdkKind.FULL_JDK_21
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AbstractFirPsiDiagnosticTest : AbstractFirDiagnosticTestBase(FirParser.Psi)
|
||||
abstract class AbstractFirLightTreeDiagnosticsTest : AbstractFirDiagnosticTestBase(FirParser.LightTree) {
|
||||
override fun configure(builder: TestConfigurationBuilder) {
|
||||
@@ -218,6 +198,14 @@ fun TestConfigurationBuilder.baseFirDiagnosticTestConfiguration(
|
||||
}
|
||||
}
|
||||
|
||||
forTestsMatching("compiler/testData/diagnostics/tests/testsWithJava21/*") {
|
||||
defaultDirectives {
|
||||
JDK_KIND with TestJdkKind.FULL_JDK_21
|
||||
+WITH_STDLIB
|
||||
+WITH_REFLECT
|
||||
}
|
||||
}
|
||||
|
||||
forTestsMatching("compiler/fir/analysis-tests/testData/resolveWithStdlib/properties/backingField/*") {
|
||||
defaultDirectives {
|
||||
LANGUAGE + "+ExplicitBackingFields"
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.test.runners
|
||||
|
||||
import org.jetbrains.kotlin.test.TestJdkKind
|
||||
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
|
||||
import org.jetbrains.kotlin.test.directives.ConfigurationDirectives
|
||||
import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives
|
||||
|
||||
@Jdk21Test
|
||||
abstract class AbstractJdk21DiagnosticTest : AbstractDiagnosticTest() {
|
||||
override fun configure(builder: TestConfigurationBuilder) {
|
||||
super.configure(builder)
|
||||
builder.defaultDirectives {
|
||||
JvmEnvironmentConfigurationDirectives.JDK_KIND with TestJdkKind.FULL_JDK_21
|
||||
+ConfigurationDirectives.WITH_STDLIB
|
||||
+JvmEnvironmentConfigurationDirectives.WITH_REFLECT
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.test.runners
|
||||
|
||||
import org.junit.jupiter.api.Tag
|
||||
|
||||
/**
|
||||
* This tag is only necessary while JDK 21 is not released, so cannot be obtained via toolchain.
|
||||
* See KT-58765 for tracking
|
||||
*/
|
||||
@Tag("Jdk21Test")
|
||||
annotation class Jdk21Test
|
||||
-12
@@ -26,10 +26,6 @@ fun generateJUnit5CompilerTests(args: Array<String>, mainClassName: String?) {
|
||||
model("diagnostics/testsWithStdLib", excludedPattern = excludedCustomTestdataPattern)
|
||||
}
|
||||
|
||||
testClass<AbstractJdk21DiagnosticTest> {
|
||||
model("diagnostics/testsWithJdk21", excludedPattern = excludedCustomTestdataPattern)
|
||||
}
|
||||
|
||||
testClass<AbstractDiagnosticUsingJavacTest> {
|
||||
model("diagnostics/tests/javac", pattern = "^(.*)\\.kts?$", excludedPattern = excludedCustomTestdataPattern)
|
||||
}
|
||||
@@ -218,14 +214,6 @@ fun generateJUnit5CompilerTests(args: Array<String>, mainClassName: String?) {
|
||||
model("diagnostics/testsWithStdLib", excludedPattern = excludedCustomTestdataPattern)
|
||||
}
|
||||
|
||||
testClass<AbstractFirPsiJdk21DiagnosticTest> {
|
||||
model("diagnostics/testsWithJdk21", excludedPattern = excludedCustomTestdataPattern)
|
||||
}
|
||||
|
||||
testClass<AbstractFirLightTreeJdk21DiagnosticTest> {
|
||||
model("diagnostics/testsWithJdk21", excludedPattern = excludedCustomTestdataPattern)
|
||||
}
|
||||
|
||||
testClass<AbstractFirPsiWithActualizerDiagnosticsTest>(suiteTestClassName = "FirOldFrontendMPPDiagnosticsWithPsiTestGenerated") {
|
||||
model("diagnostics/tests/multiplatform", pattern = "^(.*)\\.kts?$", excludedPattern = excludedCustomTestdataPattern)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user