diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 585d5a9f05e..6edeb3a65b9 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -936,18 +936,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Bridges extends AbstractIrBlackBoxCodegenTest { - @TestMetadata("jsName.kt") - public void ignoredJsName() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/bridges/jsName.kt"); - doTest(fileName); - } - - @TestMetadata("jsNative.kt") - public void ignoredJsNative() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/bridges/jsNative.kt"); - doTest(fileName); - } - public void testAllFilesPresentInBridges() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/bridges"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -8841,18 +8829,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class LocalClasses extends AbstractIrBlackBoxCodegenTest { - @TestMetadata("closureOfInnerLocalClass.kt") - public void ignoredClosureOfInnerLocalClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/localClasses/closureOfInnerLocalClass.kt"); - doTest(fileName); - } - - @TestMetadata("closureWithSelfInstantiation.kt") - public void ignoredClosureWithSelfInstantiation() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/localClasses/closureWithSelfInstantiation.kt"); - doTest(fileName); - } - public void testAllFilesPresentInLocalClasses() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/localClasses"), Pattern.compile("^(.+)\\.kt$"), true); } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 77179a62a0d..376ba39723d 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -936,18 +936,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Bridges extends AbstractBlackBoxCodegenTest { - @TestMetadata("jsName.kt") - public void ignoredJsName() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/bridges/jsName.kt"); - doTest(fileName); - } - - @TestMetadata("jsNative.kt") - public void ignoredJsNative() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/bridges/jsNative.kt"); - doTest(fileName); - } - public void testAllFilesPresentInBridges() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/bridges"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -8841,18 +8829,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class LocalClasses extends AbstractBlackBoxCodegenTest { - @TestMetadata("closureOfInnerLocalClass.kt") - public void ignoredClosureOfInnerLocalClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/localClasses/closureOfInnerLocalClass.kt"); - doTest(fileName); - } - - @TestMetadata("closureWithSelfInstantiation.kt") - public void ignoredClosureWithSelfInstantiation() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/localClasses/closureWithSelfInstantiation.kt"); - doTest(fileName); - } - public void testAllFilesPresentInLocalClasses() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/localClasses"), Pattern.compile("^(.+)\\.kt$"), true); } diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/generator/SimpleTestClassModel.java b/generators/src/org/jetbrains/kotlin/generators/tests/generator/SimpleTestClassModel.java index 1800e9ead1b..75531cb38ba 100644 --- a/generators/src/org/jetbrains/kotlin/generators/tests/generator/SimpleTestClassModel.java +++ b/generators/src/org/jetbrains/kotlin/generators/tests/generator/SimpleTestClassModel.java @@ -234,5 +234,10 @@ public class SimpleTestClassModel implements TestClassModel { public void generateSignature(@NotNull Printer p) { TestMethodModel.DefaultImpls.generateSignature(this, p); } + + @Override + public boolean shouldBeGenerated() { + return true; + } } } diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/generator/SimpleTestMethodModel.java b/generators/src/org/jetbrains/kotlin/generators/tests/generator/SimpleTestMethodModel.java index d06b8b377fc..57a5912e825 100644 --- a/generators/src/org/jetbrains/kotlin/generators/tests/generator/SimpleTestMethodModel.java +++ b/generators/src/org/jetbrains/kotlin/generators/tests/generator/SimpleTestMethodModel.java @@ -117,7 +117,8 @@ public class SimpleTestMethodModel implements TestMethodModel { } } - private boolean shouldBeGenerated() { + @Override + public boolean shouldBeGenerated() { if (targetBackend == TargetBackend.ANY) return true; List backends = InTextDirectivesUtils.findLinesWithPrefixesRemoved(textWithDirectives(), "// TARGET_BACKEND: "); @@ -149,7 +150,7 @@ public class SimpleTestMethodModel implements TestMethodModel { String relativePath = FileUtil.getRelativePath(rootDir, file.getParentFile()); unescapedName = relativePath + "-" + StringUtil.capitalize(extractedName); } - return (!shouldBeGenerated() ? "ignored" : "test") + StringUtil.capitalize(TestGeneratorUtil.escapeForJavaIdentifier(unescapedName)); + return "test" + StringUtil.capitalize(TestGeneratorUtil.escapeForJavaIdentifier(unescapedName)); } @Override diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/generator/SingleClassTestModel.java b/generators/src/org/jetbrains/kotlin/generators/tests/generator/SingleClassTestModel.java index 54909af3d7d..1f2abb65c8d 100644 --- a/generators/src/org/jetbrains/kotlin/generators/tests/generator/SingleClassTestModel.java +++ b/generators/src/org/jetbrains/kotlin/generators/tests/generator/SingleClassTestModel.java @@ -160,5 +160,10 @@ public class SingleClassTestModel implements TestClassModel { public void generateSignature(@NotNull Printer p) { TestMethodModel.DefaultImpls.generateSignature(this, p); } + + @Override + public boolean shouldBeGenerated() { + return true; + } } } diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/generator/TestGenerator.java b/generators/src/org/jetbrains/kotlin/generators/tests/generator/TestGenerator.java index 6cb1dea5fa5..d423612fe5a 100644 --- a/generators/src/org/jetbrains/kotlin/generators/tests/generator/TestGenerator.java +++ b/generators/src/org/jetbrains/kotlin/generators/tests/generator/TestGenerator.java @@ -168,6 +168,9 @@ public class TestGenerator { for (Iterator iterator = testMethods.iterator(); iterator.hasNext(); ) { MethodModel methodModel = iterator.next(); + + if (!methodModel.shouldBeGenerated()) continue; + generateTestMethod(p, methodModel); if (iterator.hasNext() || !innerTestClasses.isEmpty()) { p.println(); diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/generator/TestModel.kt b/generators/src/org/jetbrains/kotlin/generators/tests/generator/TestModel.kt index 9058baff036..a7826cd4c1a 100644 --- a/generators/src/org/jetbrains/kotlin/generators/tests/generator/TestModel.kt +++ b/generators/src/org/jetbrains/kotlin/generators/tests/generator/TestModel.kt @@ -31,6 +31,7 @@ interface TestClassModel : TestEntityModel { } interface MethodModel : TestEntityModel { + fun shouldBeGenerated(): Boolean = true fun generateSignature(p: Printer) fun generateBody(p: Printer) } diff --git a/idea/tests/org/jetbrains/kotlin/idea/decompiler/textBuilder/CommonDecompiledTextFromJsMetadataTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/decompiler/textBuilder/CommonDecompiledTextFromJsMetadataTestGenerated.java index af45dcccc3a..acf1f33ea26 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/decompiler/textBuilder/CommonDecompiledTextFromJsMetadataTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/decompiler/textBuilder/CommonDecompiledTextFromJsMetadataTestGenerated.java @@ -31,12 +31,6 @@ import java.util.regex.Pattern; @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public class CommonDecompiledTextFromJsMetadataTestGenerated extends AbstractCommonDecompiledTextFromJsMetadataTest { - @TestMetadata("FlexibleTypes") - public void ignoredFlexibleTypes() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/decompiler/decompiledText/FlexibleTypes/"); - doTest(fileName); - } - public void testAllFilesPresentInDecompiledText() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/decompiler/decompiledText"), Pattern.compile("^([^\\.]+)$"), true); } diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index a0b10a3986b..acd38d367f3 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -1236,12 +1236,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Bridges extends AbstractJsCodegenBoxTest { - @TestMetadata("objectClone.kt") - public void ignoredObjectClone() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/bridges/objectClone.kt"); - doTest(fileName); - } - public void testAllFilesPresentInBridges() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/bridges"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -3252,18 +3246,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Classes extends AbstractJsCodegenBoxTest { - @TestMetadata("classCompanionInitializationWithJava.kt") - public void ignoredClassCompanionInitializationWithJava() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/classCompanionInitializationWithJava.kt"); - doTest(fileName); - } - - @TestMetadata("interfaceCompanionInitializationWithJava.kt") - public void ignoredInterfaceCompanionInitializationWithJava() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/classes/interfaceCompanionInitializationWithJava.kt"); - doTest(fileName); - } - public void testAllFilesPresentInClasses() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/classes"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -9410,30 +9392,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class InnerNested extends AbstractJsCodegenBoxTest { - @TestMetadata("innerGenericClassFromJava.kt") - public void ignoredInnerGenericClassFromJava() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/innerGenericClassFromJava.kt"); - doTest(fileName); - } - - @TestMetadata("innerJavaClass.kt") - public void ignoredInnerJavaClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/innerJavaClass.kt"); - doTest(fileName); - } - - @TestMetadata("protectedNestedClass.kt") - public void ignoredProtectedNestedClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/protectedNestedClass.kt"); - doTest(fileName); - } - - @TestMetadata("protectedNestedClassFromJava.kt") - public void ignoredProtectedNestedClassFromJava() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/protectedNestedClassFromJava.kt"); - doTest(fileName); - } - public void testAllFilesPresentInInnerNested() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/innerNested"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -9556,42 +9514,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class SuperConstructorCall extends AbstractJsCodegenBoxTest { - @TestMetadata("innerExtendsOuter.kt") - public void ignoredInnerExtendsOuter() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/superConstructorCall/innerExtendsOuter.kt"); - doTest(fileName); - } - - @TestMetadata("localExtendsInner.kt") - public void ignoredLocalExtendsInner() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/superConstructorCall/localExtendsInner.kt"); - doTest(fileName); - } - - @TestMetadata("objectExtendsInner.kt") - public void ignoredObjectExtendsInner() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInner.kt"); - doTest(fileName); - } - - @TestMetadata("objectExtendsInnerDefaultArgument.kt") - public void ignoredObjectExtendsInnerDefaultArgument() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerDefaultArgument.kt"); - doTest(fileName); - } - - @TestMetadata("objectExtendsInnerOfLocalVarargAndDefault.kt") - public void ignoredObjectExtendsInnerOfLocalVarargAndDefault() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalVarargAndDefault.kt"); - doTest(fileName); - } - - @TestMetadata("objectExtendsInnerOfLocalWithCapture.kt") - public void ignoredObjectExtendsInnerOfLocalWithCapture() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalWithCapture.kt"); - doTest(fileName); - } - public void testAllFilesPresentInSuperConstructorCall() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/innerNested/superConstructorCall"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -19190,30 +19112,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class SecondaryConstructors extends AbstractJsCodegenBoxTest { - @TestMetadata("withGenerics.kt") - public void ignoredWithGenerics() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/secondaryConstructors/withGenerics.kt"); - doTest(fileName); - } - - @TestMetadata("withPrimary.kt") - public void ignoredWithPrimary() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/secondaryConstructors/withPrimary.kt"); - doTest(fileName); - } - - @TestMetadata("withVarargs.kt") - public void ignoredWithVarargs() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/secondaryConstructors/withVarargs.kt"); - doTest(fileName); - } - - @TestMetadata("withoutPrimary.kt") - public void ignoredWithoutPrimary() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/secondaryConstructors/withoutPrimary.kt"); - doTest(fileName); - } - @TestMetadata("accessToCompanion.kt") public void testAccessToCompanion() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/secondaryConstructors/accessToCompanion.kt"); @@ -19378,6 +19276,7 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/secondaryConstructors/withReturnUnit.kt"); doTest(fileName); } + } @TestMetadata("compiler/testData/codegen/box/smap")