[Test] Use JDK 11 instead of JDK 9 in modern jdk tests

This commit is contained in:
Dmitriy Novozhilov
2021-07-30 18:51:44 +03:00
committed by teamcityserver
parent fd537e7d5a
commit 5206b45ce3
19 changed files with 175 additions and 169 deletions
@@ -29,6 +29,9 @@ enum class TestJdkKind(val requiresSeparateProcess: Boolean = false) {
// JDK found at $JDK_9
FULL_JDK_9(requiresSeparateProcess = true),
// JDK found at $JDK_15
FULL_JDK_11(requiresSeparateProcess = true),
// JDK found at $JDK_15
FULL_JDK_15(requiresSeparateProcess = true),
@@ -26,6 +26,89 @@ public class BlackBoxModernJdkCodegenTestGenerated extends AbstractBlackBoxCodeg
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxModernJdk"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@Nested
@Tag("<modernJava>")
@TestMetadata("compiler/testData/codegen/boxModernJdk/testsWithJava11")
@TestDataPath("$PROJECT_ROOT")
public class TestsWithJava11 {
@Test
public void testAllFilesPresentInTestsWithJava11() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxModernJdk/testsWithJava11"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@Test
@TestMetadata("concatDynamic.kt")
public void testConcatDynamic() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamic.kt");
}
@Test
@TestMetadata("concatDynamic200.kt")
public void testConcatDynamic200() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamic200.kt");
}
@Test
@TestMetadata("concatDynamic200Long.kt")
public void testConcatDynamic200Long() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamic200Long.kt");
}
@Test
@TestMetadata("concatDynamic201.kt")
public void testConcatDynamic201() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamic201.kt");
}
@Test
@TestMetadata("concatDynamicIndy200.kt")
public void testConcatDynamicIndy200() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamicIndy200.kt");
}
@Test
@TestMetadata("concatDynamicIndy200Long.kt")
public void testConcatDynamicIndy200Long() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamicIndy200Long.kt");
}
@Test
@TestMetadata("concatDynamicIndy201.kt")
public void testConcatDynamicIndy201() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamicIndy201.kt");
}
@Test
@TestMetadata("concatDynamicInlineClasses.kt")
public void testConcatDynamicInlineClasses() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamicInlineClasses.kt");
}
@Test
@TestMetadata("concatDynamicSpecialSymbols.kt")
public void testConcatDynamicSpecialSymbols() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamicSpecialSymbols.kt");
}
@Test
@TestMetadata("concatDynamicWithInline.kt")
public void testConcatDynamicWithInline() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamicWithInline.kt");
}
@Test
@TestMetadata("kt36984.kt")
public void testKt36984() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/kt36984.kt");
}
@Test
@TestMetadata("varHandle.kt")
public void testVarHandle() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/varHandle.kt");
}
}
@Nested
@Tag("<modernJava>")
@TestMetadata("compiler/testData/codegen/boxModernJdk/testsWithJava15")
@@ -165,87 +248,4 @@ public class BlackBoxModernJdkCodegenTestGenerated extends AbstractBlackBoxCodeg
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/sealedJavaInterfaceViaKotlinReflection.kt");
}
}
@Nested
@Tag("<modernJava>")
@TestMetadata("compiler/testData/codegen/boxModernJdk/testsWithJava9")
@TestDataPath("$PROJECT_ROOT")
public class TestsWithJava9 {
@Test
public void testAllFilesPresentInTestsWithJava9() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxModernJdk/testsWithJava9"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@Test
@TestMetadata("concatDynamic.kt")
public void testConcatDynamic() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamic.kt");
}
@Test
@TestMetadata("concatDynamic200.kt")
public void testConcatDynamic200() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamic200.kt");
}
@Test
@TestMetadata("concatDynamic200Long.kt")
public void testConcatDynamic200Long() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamic200Long.kt");
}
@Test
@TestMetadata("concatDynamic201.kt")
public void testConcatDynamic201() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamic201.kt");
}
@Test
@TestMetadata("concatDynamicIndy200.kt")
public void testConcatDynamicIndy200() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamicIndy200.kt");
}
@Test
@TestMetadata("concatDynamicIndy200Long.kt")
public void testConcatDynamicIndy200Long() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamicIndy200Long.kt");
}
@Test
@TestMetadata("concatDynamicIndy201.kt")
public void testConcatDynamicIndy201() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamicIndy201.kt");
}
@Test
@TestMetadata("concatDynamicInlineClasses.kt")
public void testConcatDynamicInlineClasses() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamicInlineClasses.kt");
}
@Test
@TestMetadata("concatDynamicSpecialSymbols.kt")
public void testConcatDynamicSpecialSymbols() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamicSpecialSymbols.kt");
}
@Test
@TestMetadata("concatDynamicWithInline.kt")
public void testConcatDynamicWithInline() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamicWithInline.kt");
}
@Test
@TestMetadata("kt36984.kt")
public void testKt36984() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/kt36984.kt");
}
@Test
@TestMetadata("varHandle.kt")
public void testVarHandle() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/varHandle.kt");
}
}
}
@@ -26,6 +26,89 @@ public class IrBlackBoxModernJdkCodegenTestGenerated extends AbstractIrBlackBoxC
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxModernJdk"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Nested
@Tag("<modernJava>")
@TestMetadata("compiler/testData/codegen/boxModernJdk/testsWithJava11")
@TestDataPath("$PROJECT_ROOT")
public class TestsWithJava11 {
@Test
public void testAllFilesPresentInTestsWithJava11() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxModernJdk/testsWithJava11"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("concatDynamic.kt")
public void testConcatDynamic() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamic.kt");
}
@Test
@TestMetadata("concatDynamic200.kt")
public void testConcatDynamic200() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamic200.kt");
}
@Test
@TestMetadata("concatDynamic200Long.kt")
public void testConcatDynamic200Long() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamic200Long.kt");
}
@Test
@TestMetadata("concatDynamic201.kt")
public void testConcatDynamic201() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamic201.kt");
}
@Test
@TestMetadata("concatDynamicIndy200.kt")
public void testConcatDynamicIndy200() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamicIndy200.kt");
}
@Test
@TestMetadata("concatDynamicIndy200Long.kt")
public void testConcatDynamicIndy200Long() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamicIndy200Long.kt");
}
@Test
@TestMetadata("concatDynamicIndy201.kt")
public void testConcatDynamicIndy201() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamicIndy201.kt");
}
@Test
@TestMetadata("concatDynamicInlineClasses.kt")
public void testConcatDynamicInlineClasses() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamicInlineClasses.kt");
}
@Test
@TestMetadata("concatDynamicSpecialSymbols.kt")
public void testConcatDynamicSpecialSymbols() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamicSpecialSymbols.kt");
}
@Test
@TestMetadata("concatDynamicWithInline.kt")
public void testConcatDynamicWithInline() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/concatDynamicWithInline.kt");
}
@Test
@TestMetadata("kt36984.kt")
public void testKt36984() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/kt36984.kt");
}
@Test
@TestMetadata("varHandle.kt")
public void testVarHandle() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/varHandle.kt");
}
}
@Nested
@Tag("<modernJava>")
@TestMetadata("compiler/testData/codegen/boxModernJdk/testsWithJava15")
@@ -165,87 +248,4 @@ public class IrBlackBoxModernJdkCodegenTestGenerated extends AbstractIrBlackBoxC
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/sealedJavaInterfaceViaKotlinReflection.kt");
}
}
@Nested
@Tag("<modernJava>")
@TestMetadata("compiler/testData/codegen/boxModernJdk/testsWithJava9")
@TestDataPath("$PROJECT_ROOT")
public class TestsWithJava9 {
@Test
public void testAllFilesPresentInTestsWithJava9() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxModernJdk/testsWithJava9"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("concatDynamic.kt")
public void testConcatDynamic() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamic.kt");
}
@Test
@TestMetadata("concatDynamic200.kt")
public void testConcatDynamic200() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamic200.kt");
}
@Test
@TestMetadata("concatDynamic200Long.kt")
public void testConcatDynamic200Long() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamic200Long.kt");
}
@Test
@TestMetadata("concatDynamic201.kt")
public void testConcatDynamic201() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamic201.kt");
}
@Test
@TestMetadata("concatDynamicIndy200.kt")
public void testConcatDynamicIndy200() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamicIndy200.kt");
}
@Test
@TestMetadata("concatDynamicIndy200Long.kt")
public void testConcatDynamicIndy200Long() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamicIndy200Long.kt");
}
@Test
@TestMetadata("concatDynamicIndy201.kt")
public void testConcatDynamicIndy201() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamicIndy201.kt");
}
@Test
@TestMetadata("concatDynamicInlineClasses.kt")
public void testConcatDynamicInlineClasses() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamicInlineClasses.kt");
}
@Test
@TestMetadata("concatDynamicSpecialSymbols.kt")
public void testConcatDynamicSpecialSymbols() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamicSpecialSymbols.kt");
}
@Test
@TestMetadata("concatDynamicWithInline.kt")
public void testConcatDynamicWithInline() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/concatDynamicWithInline.kt");
}
@Test
@TestMetadata("kt36984.kt")
public void testKt36984() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/kt36984.kt");
}
@Test
@TestMetadata("varHandle.kt")
public void testVarHandle() throws Exception {
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava9/varHandle.kt");
}
}
}
@@ -180,7 +180,7 @@ class JvmBoxRunner(testServices: TestServices) : JvmBinaryArtifactHandler(testSe
classFileFactory: ClassFileFactory
): String {
val jdkHome = when (jdkKind) {
TestJdkKind.FULL_JDK_9 -> KtTestUtil.getJdk9Home()
TestJdkKind.FULL_JDK_11 -> KtTestUtil.getJdk11Home()
TestJdkKind.FULL_JDK_15 -> KtTestUtil.getJdk15Home()
TestJdkKind.FULL_JDK_17 -> KtTestUtil.getJdk17Home()
else -> error("Unsupported JDK kind: $jdkKind")
@@ -56,8 +56,8 @@ abstract class AbstractJvmBlackBoxCodegenTestBase<R : ResultingArtifact.Frontend
}
}
forTestsMatching("compiler/testData/codegen/boxModernJdk/testsWithJava9/*") {
configureModernJavaTest(TestJdkKind.FULL_JDK_9, JvmTarget.JVM_9)
forTestsMatching("compiler/testData/codegen/boxModernJdk/testsWithJava11/*") {
configureModernJavaTest(TestJdkKind.FULL_JDK_11, JvmTarget.JVM_11)
}
forTestsMatching("compiler/testData/codegen/boxModernJdk/testsWithJava15/*") {
@@ -169,6 +169,9 @@ class JvmEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfig
TestJdkKind.FULL_JDK_9 -> {
configuration.put(JVMConfigurationKeys.JDK_HOME, KtTestUtil.getJdk9Home())
}
TestJdkKind.FULL_JDK_11 -> {
configuration.put(JVMConfigurationKeys.JDK_HOME, KtTestUtil.getJdk11Home())
}
TestJdkKind.FULL_JDK_15 -> {
configuration.put(JVMConfigurationKeys.JDK_HOME, KtTestUtil.getJdk15Home())
}