Add tests for type annotations with unresolved reference and invalid target (KT-28424, KT-28449)

This commit is contained in:
victor.petukhov
2018-11-27 12:45:52 +03:00
parent 620969652a
commit f5d44003cd
36 changed files with 1021 additions and 1 deletions
@@ -1359,6 +1359,100 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Annotations extends AbstractDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/annotations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Type_annotations extends AbstractDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInType_annotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Neg extends AbstractDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
@TestMetadata("1.kt")
public void test1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/1.kt");
}
@TestMetadata("10.kt")
public void test10() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/10.kt");
}
@TestMetadata("11.kt")
public void test11() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/11.kt");
}
@TestMetadata("2.kt")
public void test2() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/2.kt");
}
@TestMetadata("3.kt")
public void test3() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/3.kt");
}
@TestMetadata("4.kt")
public void test4() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/4.kt");
}
@TestMetadata("5.kt")
public void test5() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/5.kt");
}
@TestMetadata("6.kt")
public void test6() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/6.kt");
}
@TestMetadata("7.kt")
public void test7() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/7.kt");
}
@TestMetadata("8.kt")
public void test8() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/8.kt");
}
@TestMetadata("9.kt")
public void test9() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/9.kt");
}
public void testAllFilesPresentInNeg() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
}
}
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -634,4 +634,111 @@ public class BlackBoxCodegenTestSpecGenerated extends AbstractBlackBoxCodegenTes
}
}
}
@TestMetadata("compiler/tests-spec/testData/codegen/box/notLinked")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class NotLinked extends AbstractBlackBoxCodegenTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInNotLinked() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/notLinked"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("compiler/tests-spec/testData/codegen/box/notLinked/annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Annotations extends AbstractBlackBoxCodegenTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/notLinked/annotations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Type_annotations extends AbstractBlackBoxCodegenTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInType_annotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Neg extends AbstractBlackBoxCodegenTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
@TestMetadata("1.kt")
public void test1() throws Exception {
runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/1.kt");
}
@TestMetadata("10.kt")
public void test10() throws Exception {
runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/10.kt");
}
@TestMetadata("11.kt")
public void test11() throws Exception {
runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/11.kt");
}
@TestMetadata("2.kt")
public void test2() throws Exception {
runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/2.kt");
}
@TestMetadata("3.kt")
public void test3() throws Exception {
runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/3.kt");
}
@TestMetadata("4.kt")
public void test4() throws Exception {
runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/4.kt");
}
@TestMetadata("5.kt")
public void test5() throws Exception {
runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/5.kt");
}
@TestMetadata("6.kt")
public void test6() throws Exception {
runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/6.kt");
}
@TestMetadata("7.kt")
public void test7() throws Exception {
runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/7.kt");
}
@TestMetadata("8.kt")
public void test8() throws Exception {
runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/8.kt");
}
@TestMetadata("9.kt")
public void test9() throws Exception {
runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/9.kt");
}
public void testAllFilesPresentInNeg() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
}
}
}
}
}