JVM IR: unmute boxInline tests on enclosing method/class

In box tests, only check that Java reflection does not crash on the
EnclosingMethod attribute generated in these classes. If it doesn't
crash, most likely it returns the value that can be read from the class
file by ASM, which is what the newly added bytecode listing tests are
checking now.
This commit is contained in:
Alexander Udalov
2020-09-01 21:52:58 +02:00
parent 985088a3f1
commit 0dea6b94c6
18 changed files with 719 additions and 63 deletions
@@ -446,6 +446,39 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
public void testSimpleNamed() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/inline/simpleNamed.kt");
}
@TestMetadata("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class EnclosingInfo extends AbstractBytecodeListingTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInEnclosingInfo() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@TestMetadata("crossinlineLambdaChain.kt")
public void testCrossinlineLambdaChain() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo/crossinlineLambdaChain.kt");
}
@TestMetadata("kt10259.kt")
public void testKt10259() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo/kt10259.kt");
}
@TestMetadata("transformedConstructor.kt")
public void testTransformedConstructor() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo/transformedConstructor.kt");
}
@TestMetadata("transformedConstructorWithNestedInline.kt")
public void testTransformedConstructorWithNestedInline() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo/transformedConstructorWithNestedInline.kt");
}
}
}
@TestMetadata("compiler/testData/codegen/bytecodeListing/inlineClasses")
@@ -416,6 +416,39 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes
public void testSimpleNamed() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/inline/simpleNamed.kt");
}
@TestMetadata("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class EnclosingInfo extends AbstractIrBytecodeListingTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInEnclosingInfo() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("crossinlineLambdaChain.kt")
public void testCrossinlineLambdaChain() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo/crossinlineLambdaChain.kt");
}
@TestMetadata("kt10259.kt")
public void testKt10259() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo/kt10259.kt");
}
@TestMetadata("transformedConstructor.kt")
public void testTransformedConstructor() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo/transformedConstructor.kt");
}
@TestMetadata("transformedConstructorWithNestedInline.kt")
public void testTransformedConstructorWithNestedInline() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo/transformedConstructorWithNestedInline.kt");
}
}
}
@TestMetadata("compiler/testData/codegen/bytecodeListing/inlineClasses")