[FIR] add tests on external annotations

Tests are excluded in COMPILED_JAVA mode because in this
mode external annotations are not present at all

^KT-62310
This commit is contained in:
Dmitrii Gridin
2023-10-05 11:46:50 +02:00
committed by Space Team
parent e452113a7a
commit 2cac922cd0
45 changed files with 1158 additions and 17 deletions
@@ -23,7 +23,7 @@ public class FirPsiOldFrontendForeignAnnotationsCompiledJavaTestGenerated extend
public class Tests {
@Test
public void testAllFilesPresentInTests() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "externalAnnotations");
}
@Test
@@ -146,6 +146,64 @@ public class FirPsiOldFrontendForeignAnnotationsCompiledJavaWithPsiClassReadingT
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/rxjava3Warnings.kt");
}
@Nested
@TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations")
@TestDataPath("$PROJECT_ROOT")
public class ExternalAnnotations {
@Test
public void testAllFilesPresentInExternalAnnotations() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
}
@Test
@TestMetadata("constructorParameterNotNull.kt")
public void testConstructorParameterNotNull() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/constructorParameterNotNull.kt");
}
@Test
@TestMetadata("constructorParameterNotNull2.kt")
public void testConstructorParameterNotNull2() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/constructorParameterNotNull2.kt");
}
@Test
@TestMetadata("fieldNotNull.kt")
public void testFieldNotNull() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/fieldNotNull.kt");
}
@Test
@TestMetadata("fieldNotNullAnnotationWithPackage.kt")
public void testFieldNotNullAnnotationWithPackage() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/fieldNotNullAnnotationWithPackage.kt");
}
@Test
@TestMetadata("methodNotNull.kt")
public void testMethodNotNull() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/methodNotNull.kt");
}
@Test
@TestMetadata("methodNotNullFromAnotherModule.kt")
public void testMethodNotNullFromAnotherModule() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/methodNotNullFromAnotherModule.kt");
}
@Test
@TestMetadata("methodParameterNotNull.kt")
public void testMethodParameterNotNull() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/methodParameterNotNull.kt");
}
@Test
@TestMetadata("methodParameterNotNull2.kt")
public void testMethodParameterNotNull2() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/methodParameterNotNull2.kt");
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305")
@TestDataPath("$PROJECT_ROOT")
@@ -146,6 +146,64 @@ public class FirPsiOldFrontendForeignAnnotationsSourceJavaTestGenerated extends
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/rxjava3Warnings.kt");
}
@Nested
@TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations")
@TestDataPath("$PROJECT_ROOT")
public class ExternalAnnotations {
@Test
public void testAllFilesPresentInExternalAnnotations() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
}
@Test
@TestMetadata("constructorParameterNotNull.kt")
public void testConstructorParameterNotNull() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/constructorParameterNotNull.kt");
}
@Test
@TestMetadata("constructorParameterNotNull2.kt")
public void testConstructorParameterNotNull2() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/constructorParameterNotNull2.kt");
}
@Test
@TestMetadata("fieldNotNull.kt")
public void testFieldNotNull() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/fieldNotNull.kt");
}
@Test
@TestMetadata("fieldNotNullAnnotationWithPackage.kt")
public void testFieldNotNullAnnotationWithPackage() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/fieldNotNullAnnotationWithPackage.kt");
}
@Test
@TestMetadata("methodNotNull.kt")
public void testMethodNotNull() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/methodNotNull.kt");
}
@Test
@TestMetadata("methodNotNullFromAnotherModule.kt")
public void testMethodNotNullFromAnotherModule() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/methodNotNullFromAnotherModule.kt");
}
@Test
@TestMetadata("methodParameterNotNull.kt")
public void testMethodParameterNotNull() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/methodParameterNotNull.kt");
}
@Test
@TestMetadata("methodParameterNotNull2.kt")
public void testMethodParameterNotNull2() throws Exception {
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/externalAnnotations/methodParameterNotNull2.kt");
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305")
@TestDataPath("$PROJECT_ROOT")