Add basic Java 9 module tests
This commit is contained in:
Vendored
+18
@@ -0,0 +1,18 @@
|
|||||||
|
// FILE: module-info.java
|
||||||
|
// INCLUDE_JAVA_AS_BINARY
|
||||||
|
import org.jspecify.nullness.NullMarked;
|
||||||
|
|
||||||
|
@NullMarked
|
||||||
|
module sandbox {
|
||||||
|
requires java9_annotations;
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: Test.java
|
||||||
|
public class Test {
|
||||||
|
void foo(Integer x) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
fun main(x: Test) {
|
||||||
|
x.foo(1)
|
||||||
|
}
|
||||||
Vendored
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun main(/*0*/ x: Test): kotlin.Unit
|
||||||
|
|
||||||
|
public open class Test {
|
||||||
|
public constructor Test()
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public/*package*/ open fun foo(/*0*/ x: kotlin.Int!): kotlin.Unit
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
Vendored
+19
@@ -0,0 +1,19 @@
|
|||||||
|
// ALLOW_KOTLIN_PACKAGE
|
||||||
|
|
||||||
|
// FILE: module-info.java
|
||||||
|
import org.jspecify.nullness.NullMarked;
|
||||||
|
|
||||||
|
@NullMarked
|
||||||
|
module sandbox {
|
||||||
|
requires java9_annotations;
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: Test.java
|
||||||
|
public class Test {
|
||||||
|
void foo(Integer x) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
fun main(x: Test) {
|
||||||
|
x.foo(1)
|
||||||
|
}
|
||||||
Vendored
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun main(/*0*/ x: Test): kotlin.Unit
|
||||||
|
|
||||||
|
public open class Test {
|
||||||
|
public constructor Test()
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public/*package*/ open fun foo(/*0*/ x: kotlin.Int!): kotlin.Unit
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
+18
-42
@@ -1059,51 +1059,27 @@ public class ForeignAnnotationsNoAnnotationInClasspathTestGenerated extends Abst
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava")
|
@TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
public class TypeEnhancementOnCompiledJava {
|
public class Java9Tests {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInTypeEnhancementOnCompiledJava() throws Exception {
|
public void testAllFilesPresentInJava9Tests() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("ClassTypeParameterBound.kt")
|
@TestMetadata("binaryModuleInfoAnnotation.kt")
|
||||||
public void testClassTypeParameterBound() throws Exception {
|
public void testBinaryModuleInfoAnnotation() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.kt");
|
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/binaryModuleInfoAnnotation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("ClassTypeParameterBoundWithWarnings.kt")
|
@TestMetadata("sourceModuleInfoAnnotation.kt")
|
||||||
public void testClassTypeParameterBoundWithWarnings() throws Exception {
|
public void testSourceModuleInfoAnnotation() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.kt");
|
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/sourceModuleInfoAnnotation.kt");
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("ReturnType.kt")
|
|
||||||
public void testReturnType() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ReturnType.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("ReturnTypeWithWarnings.kt")
|
|
||||||
public void testReturnTypeWithWarnings() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("ValueParameter.kt")
|
|
||||||
public void testValueParameter() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ValueParameter.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("ValueParameterWithWarnings.kt")
|
|
||||||
public void testValueParameterWithWarnings() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.kt");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-42
@@ -1059,51 +1059,27 @@ public class ForeignAnnotationsNoAnnotationInClasspathWithPsiClassReadingTestGen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava")
|
@TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
public class TypeEnhancementOnCompiledJava {
|
public class Java9Tests {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInTypeEnhancementOnCompiledJava() throws Exception {
|
public void testAllFilesPresentInJava9Tests() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("ClassTypeParameterBound.kt")
|
@TestMetadata("binaryModuleInfoAnnotation.kt")
|
||||||
public void testClassTypeParameterBound() throws Exception {
|
public void testBinaryModuleInfoAnnotation() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.kt");
|
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/binaryModuleInfoAnnotation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("ClassTypeParameterBoundWithWarnings.kt")
|
@TestMetadata("sourceModuleInfoAnnotation.kt")
|
||||||
public void testClassTypeParameterBoundWithWarnings() throws Exception {
|
public void testSourceModuleInfoAnnotation() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.kt");
|
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/sourceModuleInfoAnnotation.kt");
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("ReturnType.kt")
|
|
||||||
public void testReturnType() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ReturnType.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("ReturnTypeWithWarnings.kt")
|
|
||||||
public void testReturnTypeWithWarnings() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("ValueParameter.kt")
|
|
||||||
public void testValueParameter() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ValueParameter.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("ValueParameterWithWarnings.kt")
|
|
||||||
public void testValueParameterWithWarnings() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.kt");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-42
@@ -1059,51 +1059,27 @@ public class ForeignAnnotationsTestGenerated extends AbstractForeignAnnotationsT
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava")
|
@TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
public class TypeEnhancementOnCompiledJava {
|
public class Java9Tests {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInTypeEnhancementOnCompiledJava() throws Exception {
|
public void testAllFilesPresentInJava9Tests() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("ClassTypeParameterBound.kt")
|
@TestMetadata("binaryModuleInfoAnnotation.kt")
|
||||||
public void testClassTypeParameterBound() throws Exception {
|
public void testBinaryModuleInfoAnnotation() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.kt");
|
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/binaryModuleInfoAnnotation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("ClassTypeParameterBoundWithWarnings.kt")
|
@TestMetadata("sourceModuleInfoAnnotation.kt")
|
||||||
public void testClassTypeParameterBoundWithWarnings() throws Exception {
|
public void testSourceModuleInfoAnnotation() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.kt");
|
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java9Tests/sourceModuleInfoAnnotation.kt");
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("ReturnType.kt")
|
|
||||||
public void testReturnType() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ReturnType.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("ReturnTypeWithWarnings.kt")
|
|
||||||
public void testReturnTypeWithWarnings() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("ValueParameter.kt")
|
|
||||||
public void testValueParameter() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ValueParameter.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("ValueParameterWithWarnings.kt")
|
|
||||||
public void testValueParameterWithWarnings() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.kt");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -50,16 +50,19 @@ fun generateJUnit5CompilerTests(args: Array<String>) {
|
|||||||
testClass<AbstractForeignAnnotationsTest> {
|
testClass<AbstractForeignAnnotationsTest> {
|
||||||
model("diagnostics/foreignAnnotationsTests/tests")
|
model("diagnostics/foreignAnnotationsTests/tests")
|
||||||
model("diagnostics/foreignAnnotationsTests/java8Tests")
|
model("diagnostics/foreignAnnotationsTests/java8Tests")
|
||||||
|
model("diagnostics/foreignAnnotationsTests/java9Tests")
|
||||||
}
|
}
|
||||||
|
|
||||||
testClass<AbstractForeignAnnotationsNoAnnotationInClasspathTest> {
|
testClass<AbstractForeignAnnotationsNoAnnotationInClasspathTest> {
|
||||||
model("diagnostics/foreignAnnotationsTests/tests")
|
model("diagnostics/foreignAnnotationsTests/tests")
|
||||||
model("diagnostics/foreignAnnotationsTests/java8Tests")
|
model("diagnostics/foreignAnnotationsTests/java8Tests")
|
||||||
|
model("diagnostics/foreignAnnotationsTests/java9Tests")
|
||||||
}
|
}
|
||||||
|
|
||||||
testClass<AbstractForeignAnnotationsNoAnnotationInClasspathWithPsiClassReadingTest> {
|
testClass<AbstractForeignAnnotationsNoAnnotationInClasspathWithPsiClassReadingTest> {
|
||||||
model("diagnostics/foreignAnnotationsTests/tests")
|
model("diagnostics/foreignAnnotationsTests/tests")
|
||||||
model("diagnostics/foreignAnnotationsTests/java8Tests")
|
model("diagnostics/foreignAnnotationsTests/java8Tests")
|
||||||
|
model("diagnostics/foreignAnnotationsTests/java9Tests")
|
||||||
}
|
}
|
||||||
|
|
||||||
testClass<AbstractBlackBoxCodegenTest> {
|
testClass<AbstractBlackBoxCodegenTest> {
|
||||||
|
|||||||
Reference in New Issue
Block a user