From 9c9e13d93e774d44bb2dff2e250ef27745359b8d Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 12 Feb 2020 14:13:12 +0100 Subject: [PATCH] Minor, move obsolete test to oldLanguageVersions Ignore this directory in JVM IR boxAgainstJava tests (similarly to box tests) so that we can ignore the fact that this test doesn't pass in JVM_IR, since it shouldn't. --- .../ieee754/explicitEqualsCallNull.kt | 1 - ...ackBoxAgainstJavaCodegenTestGenerated.java | 36 ++++++++++++++++--- ...ackBoxAgainstJavaCodegenTestGenerated.java | 7 +--- .../generators/tests/GenerateCompilerTests.kt | 2 +- 4 files changed, 33 insertions(+), 13 deletions(-) rename compiler/testData/codegen/boxAgainstJava/{ => oldLanguageVersions}/ieee754/explicitEqualsCallNull.kt (99%) diff --git a/compiler/testData/codegen/boxAgainstJava/ieee754/explicitEqualsCallNull.kt b/compiler/testData/codegen/boxAgainstJava/oldLanguageVersions/ieee754/explicitEqualsCallNull.kt similarity index 99% rename from compiler/testData/codegen/boxAgainstJava/ieee754/explicitEqualsCallNull.kt rename to compiler/testData/codegen/boxAgainstJava/oldLanguageVersions/ieee754/explicitEqualsCallNull.kt index f5e8c715113..36720fd190f 100644 --- a/compiler/testData/codegen/boxAgainstJava/ieee754/explicitEqualsCallNull.kt +++ b/compiler/testData/codegen/boxAgainstJava/oldLanguageVersions/ieee754/explicitEqualsCallNull.kt @@ -29,4 +29,3 @@ fun box(): String { if (jClass.minus0().equals(jClass.null0())) return "fail 7" return "OK" } - diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxAgainstJavaCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxAgainstJavaCodegenTestGenerated.java index 21c11a6ab3e..fc475a21743 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxAgainstJavaCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxAgainstJavaCodegenTestGenerated.java @@ -349,11 +349,6 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxAga runTest("compiler/testData/codegen/boxAgainstJava/ieee754/explicitEqualsCall.kt"); } - @TestMetadata("explicitEqualsCallNull.kt") - public void testExplicitEqualsCallNull() throws Exception { - runTest("compiler/testData/codegen/boxAgainstJava/ieee754/explicitEqualsCallNull.kt"); - } - @TestMetadata("float.kt") public void testFloat() throws Exception { runTest("compiler/testData/codegen/boxAgainstJava/ieee754/float.kt"); @@ -490,6 +485,37 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxAga } } + @TestMetadata("compiler/testData/codegen/boxAgainstJava/oldLanguageVersions") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class OldLanguageVersions extends AbstractBlackBoxAgainstJavaCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInOldLanguageVersions() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/oldLanguageVersions"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @TestMetadata("compiler/testData/codegen/boxAgainstJava/oldLanguageVersions/ieee754") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Ieee754 extends AbstractBlackBoxAgainstJavaCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInIeee754() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/oldLanguageVersions/ieee754"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @TestMetadata("explicitEqualsCallNull.kt") + public void testExplicitEqualsCallNull() throws Exception { + runTest("compiler/testData/codegen/boxAgainstJava/oldLanguageVersions/ieee754/explicitEqualsCallNull.kt"); + } + } + } + @TestMetadata("compiler/testData/codegen/boxAgainstJava/platformTypes") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxAgainstJavaCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxAgainstJavaCodegenTestGenerated.java index 7246fa12cba..479a4a2e4dd 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxAgainstJavaCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxAgainstJavaCodegenTestGenerated.java @@ -26,7 +26,7 @@ public class IrBlackBoxAgainstJavaCodegenTestGenerated extends AbstractIrBlackBo } public void testAllFilesPresentInBoxAgainstJava() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true, "oldLanguageVersions"); } @TestMetadata("compiler/testData/codegen/boxAgainstJava/annotations") @@ -350,11 +350,6 @@ public class IrBlackBoxAgainstJavaCodegenTestGenerated extends AbstractIrBlackBo runTest("compiler/testData/codegen/boxAgainstJava/ieee754/explicitEqualsCall.kt"); } - @TestMetadata("explicitEqualsCallNull.kt") - public void testExplicitEqualsCallNull() throws Exception { - runTest("compiler/testData/codegen/boxAgainstJava/ieee754/explicitEqualsCallNull.kt"); - } - @TestMetadata("float.kt") public void testFloat() throws Exception { runTest("compiler/testData/codegen/boxAgainstJava/ieee754/float.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt index c97e9b29117..ea7e164876b 100644 --- a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt +++ b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt @@ -420,7 +420,7 @@ fun main(args: Array) { } testClass { - model("codegen/boxAgainstJava", targetBackend = TargetBackend.JVM_IR) + model("codegen/boxAgainstJava", targetBackend = TargetBackend.JVM_IR, excludeDirs = listOf("oldLanguageVersions")) } testClass {