FIC: add codegen tests, adapt previously tests for SAMs

This commit is contained in:
Mikhail Zarechenskiy
2019-11-19 10:14:53 +03:00
parent b7c43fc7db
commit 3849b5e723
9 changed files with 327 additions and 69 deletions
@@ -11610,6 +11610,54 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
}
}
@TestMetadata("compiler/testData/codegen/box/funInterface")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class FunInterface extends AbstractLightAnalysisModeTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInFunInterface() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/funInterface"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("basicFunInterface.kt")
public void testBasicFunInterface() throws Exception {
runTest("compiler/testData/codegen/box/funInterface/basicFunInterface.kt");
}
@TestMetadata("basicFunInterfaceConversion.kt")
public void testBasicFunInterfaceConversion() throws Exception {
runTest("compiler/testData/codegen/box/funInterface/basicFunInterfaceConversion.kt");
}
@TestMetadata("castFromAny.kt")
public void testCastFromAny() throws Exception {
runTest("compiler/testData/codegen/box/funInterface/castFromAny.kt");
}
@TestMetadata("inlinedSamWrapper.kt")
public void testInlinedSamWrapper() throws Exception {
runTest("compiler/testData/codegen/box/funInterface/inlinedSamWrapper.kt");
}
@TestMetadata("nullableSam.kt")
public void testNullableSam() throws Exception {
runTest("compiler/testData/codegen/box/funInterface/nullableSam.kt");
}
@TestMetadata("partialSam.kt")
public void testPartialSam() throws Exception {
runTest("compiler/testData/codegen/box/funInterface/partialSam.kt");
}
@TestMetadata("receiverEvaluatedOnce.kt")
public void testReceiverEvaluatedOnce() throws Exception {
runTest("compiler/testData/codegen/box/funInterface/receiverEvaluatedOnce.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/functions")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -13668,29 +13716,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
}
}
@TestMetadata("compiler/testData/codegen/box/inlineClasses/funInterface")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class FunInterface extends AbstractLightAnalysisModeTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInFunInterface() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/funInterface"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("basicFunInterface.kt")
public void testBasicFunInterface() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/funInterface/basicFunInterface.kt");
}
@TestMetadata("basicFunInterfaceConversion.kt")
public void testBasicFunInterfaceConversion() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/funInterface/basicFunInterfaceConversion.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/inlineClasses/functionNameMangling")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)