JVM, JVM IR: report error if not all parts of multifile class are @JvmSynthetic

#KT-41884 Fixed
This commit is contained in:
Alexander Udalov
2021-03-10 22:03:34 +01:00
parent 75850a618c
commit bc5fc122c5
12 changed files with 163 additions and 1 deletions
@@ -641,6 +641,22 @@ public class DiagnosticsTestWithJvmIrBackendGenerated extends AbstractDiagnostic
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/testsWithJvmBackend/multifileClasses")
@TestDataPath("$PROJECT_ROOT")
public class MultifileClasses {
@Test
public void testAllFilesPresentInMultifileClasses() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithJvmBackend/multifileClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("jvmSynthetic.kt")
public void testJvmSynthetic() throws Exception {
runTest("compiler/testData/diagnostics/testsWithJvmBackend/multifileClasses/jvmSynthetic.kt");
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/testsWithJvmBackend/valueClasses")
@TestDataPath("$PROJECT_ROOT")
@@ -629,6 +629,22 @@ public class DiagnosticsTestWithOldJvmBackendGenerated extends AbstractDiagnosti
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/testsWithJvmBackend/multifileClasses")
@TestDataPath("$PROJECT_ROOT")
public class MultifileClasses {
@Test
public void testAllFilesPresentInMultifileClasses() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithJvmBackend/multifileClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_OLD, true);
}
@Test
@TestMetadata("jvmSynthetic.kt")
public void testJvmSynthetic() throws Exception {
runTest("compiler/testData/diagnostics/testsWithJvmBackend/multifileClasses/jvmSynthetic.kt");
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/testsWithJvmBackend/valueClasses")
@TestDataPath("$PROJECT_ROOT")