From 6f7fc14695f2a6923ebe82b05b0bafb5bf2b3cb0 Mon Sep 17 00:00:00 2001 From: Alexander Korepanov Date: Wed, 3 May 2023 16:49:05 +0200 Subject: [PATCH] [JS IR] Enable all K2 klib IC tests --- ...ractIncrementalJsKlibCompilerRunnerTest.kt | 3 + ...WithScopeExpansionRunnerTestGenerated.java | 55 +++++++++++++++---- .../kotlin/generators/tests/GenerateTests.kt | 10 ++-- 3 files changed, 52 insertions(+), 16 deletions(-) diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalJsKlibCompilerRunnerTest.kt b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalJsKlibCompilerRunnerTest.kt index 0c98f704402..659ce120642 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalJsKlibCompilerRunnerTest.kt +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalJsKlibCompilerRunnerTest.kt @@ -32,4 +32,7 @@ abstract class AbstractIncrementalJsFirKlibCompilerWithScopeExpansionRunnerTest languageVersion = "2.0" } } + + override val buildLogFinder: BuildLogFinder + get() = super.buildLogFinder.copy(isFirEnabled = true) } \ No newline at end of file diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated.java b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated.java index 57fa982ecd9..1c17f7ce69a 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated.java +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated.java @@ -58,7 +58,7 @@ public class IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated e } public void testAllFilesPresentInPureKotlin() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/pureKotlin"), Pattern.compile("^([^\\.]+)$"), Pattern.compile("^(sealed|propertyRedeclaration|funRedeclaration|funVsConstructorOverloadConflict).*"), false); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/pureKotlin"), Pattern.compile("^([^\\.]+)$"), Pattern.compile("^(sealed|fileWithConstantRemoved).*"), false); } @TestMetadata("annotations") @@ -216,11 +216,6 @@ public class IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated e runTest("jps/jps-plugin/testData/incremental/pureKotlin/dependencyClassReferenced/"); } - @TestMetadata("fileWithConstantRemoved") - public void testFileWithConstantRemoved() throws Exception { - runTest("jps/jps-plugin/testData/incremental/pureKotlin/fileWithConstantRemoved/"); - } - @TestMetadata("fileWithInlineFunctionRemoved") public void testFileWithInlineFunctionRemoved() throws Exception { runTest("jps/jps-plugin/testData/incremental/pureKotlin/fileWithInlineFunctionRemoved/"); @@ -231,6 +226,16 @@ public class IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated e runTest("jps/jps-plugin/testData/incremental/pureKotlin/filesExchangePackages/"); } + @TestMetadata("funRedeclaration") + public void testFunRedeclaration() throws Exception { + runTest("jps/jps-plugin/testData/incremental/pureKotlin/funRedeclaration/"); + } + + @TestMetadata("funVsConstructorOverloadConflict") + public void testFunVsConstructorOverloadConflict() throws Exception { + runTest("jps/jps-plugin/testData/incremental/pureKotlin/funVsConstructorOverloadConflict/"); + } + @TestMetadata("functionBecameInline") public void testFunctionBecameInline() throws Exception { runTest("jps/jps-plugin/testData/incremental/pureKotlin/functionBecameInline/"); @@ -511,6 +516,11 @@ public class IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated e runTest("jps/jps-plugin/testData/incremental/pureKotlin/privateVarSignatureChanged/"); } + @TestMetadata("propertyRedeclaration") + public void testPropertyRedeclaration() throws Exception { + runTest("jps/jps-plugin/testData/incremental/pureKotlin/propertyRedeclaration/"); + } + @TestMetadata("publicPropertyWithPrivateSetter") public void testPublicPropertyWithPrivateSetter() throws Exception { runTest("jps/jps-plugin/testData/incremental/pureKotlin/publicPropertyWithPrivateSetter/"); @@ -651,7 +661,7 @@ public class IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated e } public void testAllFilesPresentInClassHierarchyAffected() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/classHierarchyAffected"), Pattern.compile("^([^\\.]+)$"), Pattern.compile("^(secondaryConstructorAdded|withIntermediateBodiesChanged|companionObjectNameChanged).*"), false); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/classHierarchyAffected"), Pattern.compile("^([^\\.]+)$"), null, false); } @TestMetadata("annotationFlagRemoved") @@ -709,6 +719,11 @@ public class IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated e runTest("jps/jps-plugin/testData/incremental/classHierarchyAffected/companionObjectMemberChanged/"); } + @TestMetadata("companionObjectNameChanged") + public void testCompanionObjectNameChanged() throws Exception { + runTest("jps/jps-plugin/testData/incremental/classHierarchyAffected/companionObjectNameChanged/"); + } + @TestMetadata("companionObjectToSimpleObject") public void testCompanionObjectToSimpleObject() throws Exception { runTest("jps/jps-plugin/testData/incremental/classHierarchyAffected/companionObjectToSimpleObject/"); @@ -824,6 +839,11 @@ public class IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated e runTest("jps/jps-plugin/testData/incremental/classHierarchyAffected/sealedClassNestedImplAdded/"); } + @TestMetadata("secondaryConstructorAdded") + public void testSecondaryConstructorAdded() throws Exception { + runTest("jps/jps-plugin/testData/incremental/classHierarchyAffected/secondaryConstructorAdded/"); + } + @TestMetadata("starProjectionUpperBoundChanged") public void testStarProjectionUpperBoundChanged() throws Exception { runTest("jps/jps-plugin/testData/incremental/classHierarchyAffected/starProjectionUpperBoundChanged/"); @@ -843,6 +863,11 @@ public class IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated e public void testVarianceChanged() throws Exception { runTest("jps/jps-plugin/testData/incremental/classHierarchyAffected/varianceChanged/"); } + + @TestMetadata("withIntermediateBodiesChanged") + public void testWithIntermediateBodiesChanged() throws Exception { + runTest("jps/jps-plugin/testData/incremental/classHierarchyAffected/withIntermediateBodiesChanged/"); + } } @TestMetadata("jps/jps-plugin/testData/incremental/js") @@ -916,7 +941,17 @@ public class IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated e } public void testAllFilesPresentInScopeExpansion() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/scopeExpansion"), Pattern.compile("^([^\\.]+)$"), Pattern.compile("^(protectedBecomesPublicAccessedTroughChild|changeTypeAliasAndUsage).*"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/scopeExpansion"), Pattern.compile("^([^\\.]+)$"), null, true); + } + + @TestMetadata("changeTypeAliasAndUsage") + public void testChangeTypeAliasAndUsage() throws Exception { + runTest("jps/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/"); + } + + @TestMetadata("protectedBecomesPublicAccessedTroughChild") + public void testProtectedBecomesPublicAccessedTroughChild() throws Exception { + runTest("jps/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/"); } @TestMetadata("jps/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage") @@ -928,7 +963,7 @@ public class IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated e } public void testAllFilesPresentInChangeTypeAliasAndUsage() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage"), Pattern.compile("^([^\\.]+)$"), Pattern.compile("^(protectedBecomesPublicAccessedTroughChild|changeTypeAliasAndUsage).*"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage"), Pattern.compile("^([^\\.]+)$"), null, true); } } @@ -941,7 +976,7 @@ public class IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated e } public void testAllFilesPresentInProtectedBecomesPublicAccessedTroughChild() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild"), Pattern.compile("^([^\\.]+)$"), Pattern.compile("^(protectedBecomesPublicAccessedTroughChild|changeTypeAliasAndUsage).*"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild"), Pattern.compile("^([^\\.]+)$"), null, true); } } } diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 4a3d0087b36..0411daa4fde 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -131,14 +131,12 @@ fun main(args: Array) { testClass { // IC of sealed interfaces are not supported in JS - // Some IC tests fail with K2 model("incremental/pureKotlin", extension = null, recursive = false, - excludedPattern = "^(sealed|propertyRedeclaration|funRedeclaration|funVsConstructorOverloadConflict).*") - model("incremental/classHierarchyAffected", extension = null, recursive = false, - excludedPattern = "^(secondaryConstructorAdded|withIntermediateBodiesChanged|companionObjectNameChanged).*") + // TODO: 'fileWithConstantRemoved' should be fixed in https://youtrack.jetbrains.com/issue/KT-58824 + excludedPattern = "^(sealed|fileWithConstantRemoved).*") + model("incremental/classHierarchyAffected", extension = null, recursive = false) model("incremental/js", extension = null, excludeParentDirs = true) - model("incremental/scopeExpansion", extension = null, excludeParentDirs = true, - excludedPattern = "^(protectedBecomesPublicAccessedTroughChild|changeTypeAliasAndUsage).*") + model("incremental/scopeExpansion", extension = null, excludeParentDirs = true) } testClass {