Make annotation collector tests more thorough
This commit is contained in:
+3
-2
@@ -31,11 +31,12 @@ import java.io.StringWriter
|
||||
abstract class AbstractAnnotationProcessorBoxTest : CodegenTestCase() {
|
||||
override fun doTest(path: String) {
|
||||
val testName = getTestName(true)
|
||||
val fileName = path + testName + ".kt"
|
||||
val ktFiles = File(path).listFiles { file -> file.isFile && file.extension.toLowerCase() == "kt" }
|
||||
val testFiles = ktFiles.map { TestFile(it.name, it.readText()) }
|
||||
val supportInheritedAnnotations = testName.startsWith("inherited")
|
||||
|
||||
val collectorExtension = createTestEnvironment(supportInheritedAnnotations)
|
||||
loadFileByFullPath(fileName)
|
||||
loadMultiFiles(testFiles)
|
||||
CodegenTestUtil.generateFiles(myEnvironment, myFiles)
|
||||
|
||||
val actualAnnotations = KotlinTestUtils.replaceHashWithStar(collectorExtension.stringWriter.toString())
|
||||
|
||||
+21
-3
@@ -77,9 +77,9 @@ public class AnnotationProcessorBoxTestGenerated extends AbstractAnnotationProce
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("inheritedSimple")
|
||||
public void testInheritedSimple() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-collector/testData/collectToFile/inheritedSimple/");
|
||||
@TestMetadata("inheritedComplex")
|
||||
public void testInheritedComplex() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-collector/testData/collectToFile/inheritedComplex/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@@ -95,12 +95,24 @@ public class AnnotationProcessorBoxTestGenerated extends AbstractAnnotationProce
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("localFunctions")
|
||||
public void testLocalFunctions() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-collector/testData/collectToFile/localFunctions/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("methodAnnotations")
|
||||
public void testMethodAnnotations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-collector/testData/collectToFile/methodAnnotations/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("multiFileTopLevelAnnotated")
|
||||
public void testMultiFileTopLevelAnnotated() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-collector/testData/collectToFile/multiFileTopLevelAnnotated/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("nestedClasses")
|
||||
public void testNestedClasses() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-collector/testData/collectToFile/nestedClasses/");
|
||||
@@ -112,4 +124,10 @@ public class AnnotationProcessorBoxTestGenerated extends AbstractAnnotationProce
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-collector/testData/collectToFile/platformStatic/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("topLevelAnnotated")
|
||||
public void testTopLevelAnnotated() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/annotation-collector/testData/collectToFile/topLevelAnnotated/");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user