JvmDefault: remove most tests on @JvmDefault

The tests are removed because JvmDefault is going to be deprecated with
error in KT-54746 and removed later in KT-57696.

Many of the removed tests already had existing counterparts with the new
modes `all` and `all-compatibility`. In this change, I've added such
tests where they were missing, and removed tests which were testing
behavior specific to the JvmDefault annotation, such as some
diagnostics.

 #KT-54746
This commit is contained in:
Alexander Udalov
2023-03-31 01:06:32 +02:00
committed by Space Team
parent ace2279631
commit 3120a35a88
210 changed files with 1267 additions and 7917 deletions
@@ -6086,6 +6086,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
@Test
@TestMetadata("callStackTrace.kt")
public void testCallStackTrace() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/callStackTrace.kt");
}
@Test
@TestMetadata("superCall.kt")
public void testSuperCall() throws Exception {
@@ -6098,12 +6104,6 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface.kt");
}
@Test
@TestMetadata("superCallFromInterface2.kt")
public void testSuperCallFromInterface2() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface2.kt");
}
@Test
@TestMetadata("superPropAccess.kt")
public void testSuperPropAccess() throws Exception {
@@ -6116,12 +6116,6 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superPropAccessFromInterface.kt");
}
@Test
@TestMetadata("superPropAccessFromInterface2.kt")
public void testSuperPropAccessFromInterface2() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superPropAccessFromInterface2.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/allCompatibility")
@TestDataPath("$PROJECT_ROOT")
@@ -6252,32 +6246,6 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
public void testNewAndOldSchemes3() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newAndOldSchemes3.kt");
}
@Test
@TestMetadata("newSchemeWithJvmDefault.kt")
public void testNewSchemeWithJvmDefault() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls")
@TestDataPath("$PROJECT_ROOT")
@Tag("codegenK2")
@Tag("firCodegen")
@UseExtTestCaseGroupProvider()
@FirPipeline()
public class NoDefaultImpls {
@Test
public void testAllFilesPresentInNoDefaultImpls() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
@Test
@TestMetadata("superPropAccessFromInterface.kt")
public void testSuperPropAccessFromInterface() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls/superPropAccessFromInterface.kt");
}
}
}
@@ -25124,20 +25092,6 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/compatibility")
@TestDataPath("$PROJECT_ROOT")
@Tag("codegenK2")
@Tag("firCodegen")
@UseExtTestCaseGroupProvider()
@FirPipeline()
public class Compatibility {
@Test
public void testAllFilesPresentInCompatibility() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvm8/defaults/compatibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/delegationBy")
@TestDataPath("$PROJECT_ROOT")
@@ -25208,20 +25162,6 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/noDelegation")
@TestDataPath("$PROJECT_ROOT")
@Tag("codegenK2")
@Tag("firCodegen")
@UseExtTestCaseGroupProvider()
@FirPipeline()
public class NoDelegation {
@Test
public void testAllFilesPresentInNoDelegation() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvm8/defaults/noDelegation"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/nonDefaultInheritance")
@TestDataPath("$PROJECT_ROOT")
@@ -6216,6 +6216,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
@Test
@TestMetadata("callStackTrace.kt")
public void testCallStackTrace() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/callStackTrace.kt");
}
@Test
@TestMetadata("superCall.kt")
public void testSuperCall() throws Exception {
@@ -6228,12 +6234,6 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface.kt");
}
@Test
@TestMetadata("superCallFromInterface2.kt")
public void testSuperCallFromInterface2() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface2.kt");
}
@Test
@TestMetadata("superPropAccess.kt")
public void testSuperPropAccess() throws Exception {
@@ -6246,12 +6246,6 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superPropAccessFromInterface.kt");
}
@Test
@TestMetadata("superPropAccessFromInterface2.kt")
public void testSuperPropAccessFromInterface2() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superPropAccessFromInterface2.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/allCompatibility")
@TestDataPath("$PROJECT_ROOT")
@@ -6388,34 +6382,6 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
public void testNewAndOldSchemes3() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newAndOldSchemes3.kt");
}
@Test
@TestMetadata("newSchemeWithJvmDefault.kt")
public void testNewSchemeWithJvmDefault() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls")
@TestDataPath("$PROJECT_ROOT")
@Tag("codegenK2")
@Tag("firCodegen")
@UseExtTestCaseGroupProvider()
@FirPipeline()
@UsePartialLinkage(mode = Mode.DISABLED)
@Tag("no-partial-linkage-may-be-skipped")
public class NoDefaultImpls {
@Test
public void testAllFilesPresentInNoDefaultImpls() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
@Test
@TestMetadata("superPropAccessFromInterface.kt")
public void testSuperPropAccessFromInterface() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls/superPropAccessFromInterface.kt");
}
}
}
@@ -25644,22 +25610,6 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/compatibility")
@TestDataPath("$PROJECT_ROOT")
@Tag("codegenK2")
@Tag("firCodegen")
@UseExtTestCaseGroupProvider()
@FirPipeline()
@UsePartialLinkage(mode = Mode.DISABLED)
@Tag("no-partial-linkage-may-be-skipped")
public class Compatibility {
@Test
public void testAllFilesPresentInCompatibility() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvm8/defaults/compatibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/delegationBy")
@TestDataPath("$PROJECT_ROOT")
@@ -25740,22 +25690,6 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/noDelegation")
@TestDataPath("$PROJECT_ROOT")
@Tag("codegenK2")
@Tag("firCodegen")
@UseExtTestCaseGroupProvider()
@FirPipeline()
@UsePartialLinkage(mode = Mode.DISABLED)
@Tag("no-partial-linkage-may-be-skipped")
public class NoDelegation {
@Test
public void testAllFilesPresentInNoDelegation() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvm8/defaults/noDelegation"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/nonDefaultInheritance")
@TestDataPath("$PROJECT_ROOT")
@@ -6021,6 +6021,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
@Test
@TestMetadata("callStackTrace.kt")
public void testCallStackTrace() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/callStackTrace.kt");
}
@Test
@TestMetadata("superCall.kt")
public void testSuperCall() throws Exception {
@@ -6033,12 +6039,6 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface.kt");
}
@Test
@TestMetadata("superCallFromInterface2.kt")
public void testSuperCallFromInterface2() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface2.kt");
}
@Test
@TestMetadata("superPropAccess.kt")
public void testSuperPropAccess() throws Exception {
@@ -6051,12 +6051,6 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superPropAccessFromInterface.kt");
}
@Test
@TestMetadata("superPropAccessFromInterface2.kt")
public void testSuperPropAccessFromInterface2() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superPropAccessFromInterface2.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/allCompatibility")
@TestDataPath("$PROJECT_ROOT")
@@ -6184,31 +6178,6 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
public void testNewAndOldSchemes3() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newAndOldSchemes3.kt");
}
@Test
@TestMetadata("newSchemeWithJvmDefault.kt")
public void testNewSchemeWithJvmDefault() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls")
@TestDataPath("$PROJECT_ROOT")
@Tag("codegen")
@Tag("k1Codegen")
@UseExtTestCaseGroupProvider()
public class NoDefaultImpls {
@Test
public void testAllFilesPresentInNoDefaultImpls() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
@Test
@TestMetadata("superPropAccessFromInterface.kt")
public void testSuperPropAccessFromInterface() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls/superPropAccessFromInterface.kt");
}
}
}
@@ -24864,19 +24833,6 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/compatibility")
@TestDataPath("$PROJECT_ROOT")
@Tag("codegen")
@Tag("k1Codegen")
@UseExtTestCaseGroupProvider()
public class Compatibility {
@Test
public void testAllFilesPresentInCompatibility() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvm8/defaults/compatibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/delegationBy")
@TestDataPath("$PROJECT_ROOT")
@@ -24942,19 +24898,6 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/noDelegation")
@TestDataPath("$PROJECT_ROOT")
@Tag("codegen")
@Tag("k1Codegen")
@UseExtTestCaseGroupProvider()
public class NoDelegation {
@Test
public void testAllFilesPresentInNoDelegation() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvm8/defaults/noDelegation"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/nonDefaultInheritance")
@TestDataPath("$PROJECT_ROOT")
@@ -6151,6 +6151,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
@Test
@TestMetadata("callStackTrace.kt")
public void testCallStackTrace() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/callStackTrace.kt");
}
@Test
@TestMetadata("superCall.kt")
public void testSuperCall() throws Exception {
@@ -6163,12 +6169,6 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface.kt");
}
@Test
@TestMetadata("superCallFromInterface2.kt")
public void testSuperCallFromInterface2() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface2.kt");
}
@Test
@TestMetadata("superPropAccess.kt")
public void testSuperPropAccess() throws Exception {
@@ -6181,12 +6181,6 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superPropAccessFromInterface.kt");
}
@Test
@TestMetadata("superPropAccessFromInterface2.kt")
public void testSuperPropAccessFromInterface2() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/superPropAccessFromInterface2.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/allCompatibility")
@TestDataPath("$PROJECT_ROOT")
@@ -6320,33 +6314,6 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
public void testNewAndOldSchemes3() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newAndOldSchemes3.kt");
}
@Test
@TestMetadata("newSchemeWithJvmDefault.kt")
public void testNewSchemeWithJvmDefault() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls")
@TestDataPath("$PROJECT_ROOT")
@Tag("codegen")
@Tag("k1Codegen")
@UseExtTestCaseGroupProvider()
@UsePartialLinkage(mode = Mode.DISABLED)
@Tag("no-partial-linkage-may-be-skipped")
public class NoDefaultImpls {
@Test
public void testAllFilesPresentInNoDefaultImpls() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
@Test
@TestMetadata("superPropAccessFromInterface.kt")
public void testSuperPropAccessFromInterface() throws Exception {
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls/superPropAccessFromInterface.kt");
}
}
}
@@ -25384,21 +25351,6 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/compatibility")
@TestDataPath("$PROJECT_ROOT")
@Tag("codegen")
@Tag("k1Codegen")
@UseExtTestCaseGroupProvider()
@UsePartialLinkage(mode = Mode.DISABLED)
@Tag("no-partial-linkage-may-be-skipped")
public class Compatibility {
@Test
public void testAllFilesPresentInCompatibility() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvm8/defaults/compatibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/delegationBy")
@TestDataPath("$PROJECT_ROOT")
@@ -25474,21 +25426,6 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/noDelegation")
@TestDataPath("$PROJECT_ROOT")
@Tag("codegen")
@Tag("k1Codegen")
@UseExtTestCaseGroupProvider()
@UsePartialLinkage(mode = Mode.DISABLED)
@Tag("no-partial-linkage-may-be-skipped")
public class NoDelegation {
@Test
public void testAllFilesPresentInNoDelegation() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvm8/defaults/noDelegation"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvm8/defaults/nonDefaultInheritance")
@TestDataPath("$PROJECT_ROOT")