Add Java8 foreign-annotations tests without jsr305.jar in the classpath
Some of them are expected to fail since neither IntelliJ class reading nor our fast class reading can read annotations on type arguments
This commit is contained in:
+30
-1
@@ -16,7 +16,36 @@
|
||||
|
||||
package org.jetbrains.kotlin.checkers
|
||||
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils
|
||||
import java.io.File
|
||||
|
||||
abstract class AbstractForeignJava8AnnotationsTest : AbstractForeignAnnotationsTest() {
|
||||
override val annotationsPath: String
|
||||
get() = "third-party/jdk8-annotations"
|
||||
get() = JAVA8_ANNOTATION_SOURCES_PATH
|
||||
}
|
||||
|
||||
abstract class AbstractForeignJava8AnnotationsNoAnnotationInClasspathTest : AbstractForeignAnnotationsNoAnnotationInClasspathTest() {
|
||||
override val annotationsPath: String
|
||||
get() = JAVA8_ANNOTATION_SOURCES_PATH
|
||||
|
||||
override fun analyzeAndCheck(testDataFile: File, files: List<TestFile>) {
|
||||
if (skipForCompiledVersion(files)) return
|
||||
super.analyzeAndCheck(testDataFile, files)
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AbstractForeignJava8AnnotationsNoAnnotationInClasspathWithFastClassReadingTest : AbstractForeignAnnotationsNoAnnotationInClasspathWithFastClassReadingTest() {
|
||||
override val annotationsPath: String
|
||||
get() = JAVA8_ANNOTATION_SOURCES_PATH
|
||||
|
||||
override fun analyzeAndCheck(testDataFile: File, files: List<TestFile>) {
|
||||
if (skipForCompiledVersion(files)) return
|
||||
super.analyzeAndCheck(testDataFile, files)
|
||||
}
|
||||
}
|
||||
|
||||
private fun skipForCompiledVersion(files: List<BaseDiagnosticsTest.TestFile>) =
|
||||
files.any { file -> InTextDirectivesUtils.isDirectiveDefined(file.expectedText, "// SKIP_COMPILED_JAVA") }
|
||||
|
||||
|
||||
private const val JAVA8_ANNOTATION_SOURCES_PATH = "third-party/jdk8-annotations"
|
||||
|
||||
Reference in New Issue
Block a user