Minor, move tests on JvmField into subdirectory

This commit is contained in:
Alexander Udalov
2018-07-16 18:24:43 +02:00
parent 715abda908
commit 79c2aa4acf
8 changed files with 113 additions and 50 deletions
@@ -1,6 +1,5 @@
// !LANGUAGE: +JvmFieldInInterface +NestedClassesInAnnotations
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// WITH_REFLECT
import kotlin.reflect.full.declaredMemberProperties
@@ -19,4 +18,4 @@ annotation class Foo {
fun box(): String {
val field = Foo.Companion::class.declaredMemberProperties.single()
return (field.annotations.single() as Ann).value + (field.get(Foo.Companion) as Bar).value
}
}
@@ -2,8 +2,8 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JS
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
// WITH_REFLECT
import kotlin.reflect.KProperty1
import kotlin.reflect.full.memberProperties
import kotlin.reflect.full.companionObject
@@ -1,6 +1,5 @@
// !LANGUAGE: +JvmFieldInInterface
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// WITH_REFLECT
import kotlin.reflect.full.declaredMemberProperties
@@ -19,4 +18,4 @@ interface Foo {
fun box(): String {
val field = Foo.Companion::class.declaredMemberProperties.single()
return (field.annotations.single() as Ann).value + (field.get(Foo.Companion) as Bar).value
}
}
@@ -18368,21 +18368,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/reflection/properties/javaStaticField.kt");
}
@TestMetadata("jvmFieldInAnnotationCompanionWithAnnotation.kt")
public void testJvmFieldInAnnotationCompanionWithAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmFieldInAnnotationCompanionWithAnnotation.kt");
}
@TestMetadata("jvmFieldInInterfaceCompanion.kt")
public void testJvmFieldInInterfaceCompanion() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmFieldInInterfaceCompanion.kt");
}
@TestMetadata("jvmFieldInInterfaceCompanionWithAnnotation.kt")
public void testJvmFieldInInterfaceCompanionWithAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmFieldInInterfaceCompanionWithAnnotation.kt");
}
@TestMetadata("kotlinPropertyInheritedInJava.kt")
public void testKotlinPropertyInheritedInJava() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/kotlinPropertyInheritedInJava.kt");
@@ -18594,6 +18579,34 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/properties/jvmField")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmField extends AbstractIrBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInJvmField() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/reflection/properties/jvmField"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
}
@TestMetadata("annotationCompanionWithAnnotation.kt")
public void testAnnotationCompanionWithAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmField/annotationCompanionWithAnnotation.kt");
}
@TestMetadata("interfaceCompanion.kt")
public void testInterfaceCompanion() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmField/interfaceCompanion.kt");
}
@TestMetadata("interfaceCompanionWithAnnotation.kt")
public void testInterfaceCompanionWithAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmField/interfaceCompanionWithAnnotation.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/properties/localDelegated")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -18368,21 +18368,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/reflection/properties/javaStaticField.kt");
}
@TestMetadata("jvmFieldInAnnotationCompanionWithAnnotation.kt")
public void testJvmFieldInAnnotationCompanionWithAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmFieldInAnnotationCompanionWithAnnotation.kt");
}
@TestMetadata("jvmFieldInInterfaceCompanion.kt")
public void testJvmFieldInInterfaceCompanion() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmFieldInInterfaceCompanion.kt");
}
@TestMetadata("jvmFieldInInterfaceCompanionWithAnnotation.kt")
public void testJvmFieldInInterfaceCompanionWithAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmFieldInInterfaceCompanionWithAnnotation.kt");
}
@TestMetadata("kotlinPropertyInheritedInJava.kt")
public void testKotlinPropertyInheritedInJava() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/kotlinPropertyInheritedInJava.kt");
@@ -18594,6 +18579,34 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/properties/jvmField")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmField extends AbstractBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInJvmField() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/reflection/properties/jvmField"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("annotationCompanionWithAnnotation.kt")
public void testAnnotationCompanionWithAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmField/annotationCompanionWithAnnotation.kt");
}
@TestMetadata("interfaceCompanion.kt")
public void testInterfaceCompanion() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmField/interfaceCompanion.kt");
}
@TestMetadata("interfaceCompanionWithAnnotation.kt")
public void testInterfaceCompanionWithAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmField/interfaceCompanionWithAnnotation.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/properties/localDelegated")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -18368,21 +18368,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/reflection/properties/javaStaticField.kt");
}
@TestMetadata("jvmFieldInAnnotationCompanionWithAnnotation.kt")
public void testJvmFieldInAnnotationCompanionWithAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmFieldInAnnotationCompanionWithAnnotation.kt");
}
@TestMetadata("jvmFieldInInterfaceCompanion.kt")
public void testJvmFieldInInterfaceCompanion() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmFieldInInterfaceCompanion.kt");
}
@TestMetadata("jvmFieldInInterfaceCompanionWithAnnotation.kt")
public void testJvmFieldInInterfaceCompanionWithAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmFieldInInterfaceCompanionWithAnnotation.kt");
}
@TestMetadata("kotlinPropertyInheritedInJava.kt")
public void testKotlinPropertyInheritedInJava() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/kotlinPropertyInheritedInJava.kt");
@@ -18594,6 +18579,34 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/properties/jvmField")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmField extends AbstractLightAnalysisModeTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInJvmField() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/reflection/properties/jvmField"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("annotationCompanionWithAnnotation.kt")
public void testAnnotationCompanionWithAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmField/annotationCompanionWithAnnotation.kt");
}
@TestMetadata("interfaceCompanion.kt")
public void testInterfaceCompanion() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmField/interfaceCompanion.kt");
}
@TestMetadata("interfaceCompanionWithAnnotation.kt")
public void testInterfaceCompanionWithAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/reflection/properties/jvmField/interfaceCompanionWithAnnotation.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/properties/localDelegated")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -16804,6 +16804,19 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/properties/jvmField")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmField extends AbstractIrJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
}
public void testAllFilesPresentInJvmField() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/reflection/properties/jvmField"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/properties/localDelegated")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -17809,6 +17809,19 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/properties/jvmField")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmField extends AbstractJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
}
public void testAllFilesPresentInJvmField() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/reflection/properties/jvmField"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/properties/localDelegated")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)