From d6c9a492ad1b6537d07d405648668cbd92968b6e Mon Sep 17 00:00:00 2001 From: Ilya Chernikov Date: Fri, 19 Jan 2024 10:43:51 +0100 Subject: [PATCH] K2 Scripting: disable K2 lightTree-based script tests they were enabled by mistake and do not work properly until LT parsing is implemented depends on #KT-60127 --- ...LFirBlackBoxCodegenBasedTestGenerated.java | 54 +------------------ ...rsedBlackBoxCodegenBasedTestGenerated.java | 54 +------------------ ...LightTreeBlackBoxCodegenTestGenerated.java | 54 +------------------ ...hIrFakeOverrideGeneratorTestGenerated.java | 54 +------------------ .../JvmAbiConsistencyTestBoxGenerated.java | 54 +------------------ .../generators/GenerateJUnit5CompilerTests.kt | 7 +-- .../tests/analysis/api/firLowLevel.kt | 6 ++- 7 files changed, 13 insertions(+), 270 deletions(-) diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java index 0715b056d60..de9f3b4faee 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java @@ -22,7 +22,7 @@ import java.util.regex.Pattern; public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBoxCodegenBasedTest { @Test public void testAllFilesPresentInBox() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, true, "cinterop"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, true, "cinterop", "script"); } @Nested @@ -51607,58 +51607,6 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo } } - @Nested - @TestMetadata("compiler/testData/codegen/box/script") - @TestDataPath("$PROJECT_ROOT") - public class Script { - @Test - public void testAllFilesPresentInScript() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/script"), Pattern.compile("^(.+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("classReference.kt") - public void testClassReference() throws Exception { - runTest("compiler/testData/codegen/box/script/classReference.kt"); - } - - @Test - @TestMetadata("localCaptureTests.kt") - public void testLocalCaptureTests() throws Exception { - runTest("compiler/testData/codegen/box/script/localCaptureTests.kt"); - } - - @Test - @TestMetadata("localCaptureTestsK2.kt") - public void testLocalCaptureTestsK2() throws Exception { - runTest("compiler/testData/codegen/box/script/localCaptureTestsK2.kt"); - } - - @Test - @TestMetadata("scripInstance.kt") - public void testScripInstance() throws Exception { - runTest("compiler/testData/codegen/box/script/scripInstance.kt"); - } - - @Test - @TestMetadata("scriptNestedClassInstance.kt") - public void testScriptNestedClassInstance() throws Exception { - runTest("compiler/testData/codegen/box/script/scriptNestedClassInstance.kt"); - } - - @Test - @TestMetadata("scriptNestedClassInstanceK2.kt") - public void testScriptNestedClassInstanceK2() throws Exception { - runTest("compiler/testData/codegen/box/script/scriptNestedClassInstanceK2.kt"); - } - - @Test - @TestMetadata("scriptPropFromAnotherModuleK2.kt") - public void testScriptPropFromAnotherModuleK2() throws Exception { - runTest("compiler/testData/codegen/box/script/scriptPropFromAnotherModuleK2.kt"); - } - } - @Nested @TestMetadata("compiler/testData/codegen/box/sealed") @TestDataPath("$PROJECT_ROOT") diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java index c3b23c76b54..7d5566fc29b 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java @@ -22,7 +22,7 @@ import java.util.regex.Pattern; public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFirReversedBlackBoxCodegenBasedTest { @Test public void testAllFilesPresentInBox() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, true, "cinterop"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, true, "cinterop", "script"); } @Nested @@ -51607,58 +51607,6 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi } } - @Nested - @TestMetadata("compiler/testData/codegen/box/script") - @TestDataPath("$PROJECT_ROOT") - public class Script { - @Test - public void testAllFilesPresentInScript() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/script"), Pattern.compile("^(.+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("classReference.kt") - public void testClassReference() throws Exception { - runTest("compiler/testData/codegen/box/script/classReference.kt"); - } - - @Test - @TestMetadata("localCaptureTests.kt") - public void testLocalCaptureTests() throws Exception { - runTest("compiler/testData/codegen/box/script/localCaptureTests.kt"); - } - - @Test - @TestMetadata("localCaptureTestsK2.kt") - public void testLocalCaptureTestsK2() throws Exception { - runTest("compiler/testData/codegen/box/script/localCaptureTestsK2.kt"); - } - - @Test - @TestMetadata("scripInstance.kt") - public void testScripInstance() throws Exception { - runTest("compiler/testData/codegen/box/script/scripInstance.kt"); - } - - @Test - @TestMetadata("scriptNestedClassInstance.kt") - public void testScriptNestedClassInstance() throws Exception { - runTest("compiler/testData/codegen/box/script/scriptNestedClassInstance.kt"); - } - - @Test - @TestMetadata("scriptNestedClassInstanceK2.kt") - public void testScriptNestedClassInstanceK2() throws Exception { - runTest("compiler/testData/codegen/box/script/scriptNestedClassInstanceK2.kt"); - } - - @Test - @TestMetadata("scriptPropFromAnotherModuleK2.kt") - public void testScriptPropFromAnotherModuleK2() throws Exception { - runTest("compiler/testData/codegen/box/script/scriptPropFromAnotherModuleK2.kt"); - } - } - @Nested @TestMetadata("compiler/testData/codegen/box/sealed") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java index 8ac357f5985..572b1034b5a 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java @@ -23,7 +23,7 @@ import java.util.regex.Pattern; public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTreeBlackBoxCodegenTest { @Test public void testAllFilesPresentInBox() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true, "script"); } @Nested @@ -51112,58 +51112,6 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr } } - @Nested - @TestMetadata("compiler/testData/codegen/box/script") - @TestDataPath("$PROJECT_ROOT") - public class Script { - @Test - public void testAllFilesPresentInScript() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/script"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); - } - - @Test - @TestMetadata("classReference.kt") - public void testClassReference() throws Exception { - runTest("compiler/testData/codegen/box/script/classReference.kt"); - } - - @Test - @TestMetadata("localCaptureTests.kt") - public void testLocalCaptureTests() throws Exception { - runTest("compiler/testData/codegen/box/script/localCaptureTests.kt"); - } - - @Test - @TestMetadata("localCaptureTestsK2.kt") - public void testLocalCaptureTestsK2() throws Exception { - runTest("compiler/testData/codegen/box/script/localCaptureTestsK2.kt"); - } - - @Test - @TestMetadata("scripInstance.kt") - public void testScripInstance() throws Exception { - runTest("compiler/testData/codegen/box/script/scripInstance.kt"); - } - - @Test - @TestMetadata("scriptNestedClassInstance.kt") - public void testScriptNestedClassInstance() throws Exception { - runTest("compiler/testData/codegen/box/script/scriptNestedClassInstance.kt"); - } - - @Test - @TestMetadata("scriptNestedClassInstanceK2.kt") - public void testScriptNestedClassInstanceK2() throws Exception { - runTest("compiler/testData/codegen/box/script/scriptNestedClassInstanceK2.kt"); - } - - @Test - @TestMetadata("scriptPropFromAnotherModuleK2.kt") - public void testScriptPropFromAnotherModuleK2() throws Exception { - runTest("compiler/testData/codegen/box/script/scriptPropFromAnotherModuleK2.kt"); - } - } - @Nested @TestMetadata("compiler/testData/codegen/box/sealed") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java index 3a4d379ed47..b4189a82672 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java @@ -23,7 +23,7 @@ import java.util.regex.Pattern; public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated extends AbstractFirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTest { @Test public void testAllFilesPresentInBox() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true, "script"); } @Nested @@ -51112,58 +51112,6 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated } } - @Nested - @TestMetadata("compiler/testData/codegen/box/script") - @TestDataPath("$PROJECT_ROOT") - public class Script { - @Test - public void testAllFilesPresentInScript() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/script"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); - } - - @Test - @TestMetadata("classReference.kt") - public void testClassReference() throws Exception { - runTest("compiler/testData/codegen/box/script/classReference.kt"); - } - - @Test - @TestMetadata("localCaptureTests.kt") - public void testLocalCaptureTests() throws Exception { - runTest("compiler/testData/codegen/box/script/localCaptureTests.kt"); - } - - @Test - @TestMetadata("localCaptureTestsK2.kt") - public void testLocalCaptureTestsK2() throws Exception { - runTest("compiler/testData/codegen/box/script/localCaptureTestsK2.kt"); - } - - @Test - @TestMetadata("scripInstance.kt") - public void testScripInstance() throws Exception { - runTest("compiler/testData/codegen/box/script/scripInstance.kt"); - } - - @Test - @TestMetadata("scriptNestedClassInstance.kt") - public void testScriptNestedClassInstance() throws Exception { - runTest("compiler/testData/codegen/box/script/scriptNestedClassInstance.kt"); - } - - @Test - @TestMetadata("scriptNestedClassInstanceK2.kt") - public void testScriptNestedClassInstanceK2() throws Exception { - runTest("compiler/testData/codegen/box/script/scriptNestedClassInstanceK2.kt"); - } - - @Test - @TestMetadata("scriptPropFromAnotherModuleK2.kt") - public void testScriptPropFromAnotherModuleK2() throws Exception { - runTest("compiler/testData/codegen/box/script/scriptPropFromAnotherModuleK2.kt"); - } - } - @Nested @TestMetadata("compiler/testData/codegen/box/sealed") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java index 7223314c6af..f2a5d657bab 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java @@ -23,7 +23,7 @@ import java.util.regex.Pattern; public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistencyTest { @Test public void testAllFilesPresentInBox() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true, "multiplatform/k2"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true, "multiplatform/k2", "script"); } @Nested @@ -50428,58 +50428,6 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency } } - @Nested - @TestMetadata("compiler/testData/codegen/box/script") - @TestDataPath("$PROJECT_ROOT") - public class Script { - @Test - public void testAllFilesPresentInScript() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/script"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); - } - - @Test - @TestMetadata("classReference.kt") - public void testClassReference() throws Exception { - runTest("compiler/testData/codegen/box/script/classReference.kt"); - } - - @Test - @TestMetadata("localCaptureTests.kt") - public void testLocalCaptureTests() throws Exception { - runTest("compiler/testData/codegen/box/script/localCaptureTests.kt"); - } - - @Test - @TestMetadata("localCaptureTestsK2.kt") - public void testLocalCaptureTestsK2() throws Exception { - runTest("compiler/testData/codegen/box/script/localCaptureTestsK2.kt"); - } - - @Test - @TestMetadata("scripInstance.kt") - public void testScripInstance() throws Exception { - runTest("compiler/testData/codegen/box/script/scripInstance.kt"); - } - - @Test - @TestMetadata("scriptNestedClassInstance.kt") - public void testScriptNestedClassInstance() throws Exception { - runTest("compiler/testData/codegen/box/script/scriptNestedClassInstance.kt"); - } - - @Test - @TestMetadata("scriptNestedClassInstanceK2.kt") - public void testScriptNestedClassInstanceK2() throws Exception { - runTest("compiler/testData/codegen/box/script/scriptNestedClassInstanceK2.kt"); - } - - @Test - @TestMetadata("scriptPropFromAnotherModuleK2.kt") - public void testScriptPropFromAnotherModuleK2() throws Exception { - runTest("compiler/testData/codegen/box/script/scriptPropFromAnotherModuleK2.kt"); - } - } - @Nested @TestMetadata("compiler/testData/codegen/box/sealed") @TestDataPath("$PROJECT_ROOT") 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 8e83651186e..cb11a67a18f 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 @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.test.utils.CUSTOM_TEST_DATA_EXTENSION_PATTERN fun generateJUnit5CompilerTests(args: Array, mainClassName: String?) { val excludedCustomTestdataPattern = CUSTOM_TEST_DATA_EXTENSION_PATTERN val k2BoxTestDir = listOf("multiplatform/k2") + val excludedScriptDirs = listOf("script") generateTestGroupSuiteWithJUnit5(args, mainClassName) { testGroup(testsRoot = "compiler/tests-common-new/tests-gen", testDataRoot = "compiler/testData") { @@ -79,7 +80,7 @@ fun generateJUnit5CompilerTests(args: Array, mainClassName: String?) { // We split JVM ABI tests into two parts, to avoid creation of a huge file, unable to analyze by IntelliJ with default settings testClass("JvmAbiConsistencyTestBoxGenerated") { - model("codegen/box", excludeDirs = k2BoxTestDir) + model("codegen/box", excludeDirs = k2BoxTestDir + excludedScriptDirs) } testClass("JvmAbiConsistencyTestRestGenerated") { @@ -276,7 +277,7 @@ fun generateJUnit5CompilerTests(args: Array, mainClassName: String?) { testGroup(testsRoot = "compiler/fir/fir2ir/tests-gen", testDataRoot = "compiler/testData") { testClass { - model("codegen/box") + model("codegen/box", excludeDirs = excludedScriptDirs) } testClass { @@ -284,7 +285,7 @@ fun generateJUnit5CompilerTests(args: Array, mainClassName: String?) { } testClass { - model("codegen/box") + model("codegen/box", excludeDirs = excludedScriptDirs) } testClass("FirLightTreeBlackBoxModernJdkCodegenTestGenerated") { diff --git a/generators/analysis-api-generator/tests/org/jetbrains/kotlin/generators/tests/analysis/api/firLowLevel.kt b/generators/analysis-api-generator/tests/org/jetbrains/kotlin/generators/tests/analysis/api/firLowLevel.kt index 94ef9261e1d..8ed64a20de8 100644 --- a/generators/analysis-api-generator/tests/org/jetbrains/kotlin/generators/tests/analysis/api/firLowLevel.kt +++ b/generators/analysis-api-generator/tests/org/jetbrains/kotlin/generators/tests/analysis/api/firLowLevel.kt @@ -332,14 +332,16 @@ internal fun TestGroupSuite.generateFirLowLevelApiTests() { testClass { model( "codegen/box", - excludeDirs = listOf("cinterop") // CInterop tests contain .DEF .H .CPP .M files, which are invalid for Compiler Core new test system + excludeDirs = listOf("cinterop", "script") // CInterop tests contain .DEF .H .CPP .M files, which are invalid for Compiler Core new test system + // script is excluded until KT-60127 is implemented ) } testClass { model( "codegen/box", - excludeDirs = listOf("cinterop") // CInterop tests contain .DEF .H .CPP .M files, which are invalid for Compiler Core new test system + excludeDirs = listOf("cinterop", "script") // CInterop tests contain .DEF .H .CPP .M files, which are invalid for Compiler Core new test system + // script is excluded until KT-60127 is implemented ) }