[Tests] Suspend Codegen Tests Improvements

This commit enables the execution of suspend box tests in a separate
test. It's a QoL improvement in the existing bb tests but, motivating
these changes, enables the new debugger stepping tests to step
coroutine code.
This commit is contained in:
pyos
2020-10-13 10:54:13 +02:00
committed by max-kammerer
parent 3291f8455b
commit e19ecdfb3d
9 changed files with 98 additions and 172 deletions
@@ -84,4 +84,24 @@ public class IrLocalVariableTestGenerated extends AbstractIrLocalVariableTest {
public void testUnderscoreNames() throws Exception {
runTest("compiler/testData/debug/localVariables/underscoreNames.kt");
}
@TestMetadata("compiler/testData/debug/localVariables/suspend")
@TestDataPath("$PROJECT_ROOT")
@RunWith(BlockJUnit4ClassRunner.class)
public static class Suspend extends AbstractIrLocalVariableTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}
@Test
public void testAllFilesPresentInSuspend() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/debug/localVariables/suspend"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/debug/localVariables/suspend/simple.kt");
}
}
}
@@ -84,4 +84,24 @@ public class LocalVariableTestGenerated extends AbstractLocalVariableTest {
public void testUnderscoreNames() throws Exception {
runTest("compiler/testData/debug/localVariables/underscoreNames.kt");
}
@TestMetadata("compiler/testData/debug/localVariables/suspend")
@TestDataPath("$PROJECT_ROOT")
@RunWith(BlockJUnit4ClassRunner.class)
public static class Suspend extends AbstractLocalVariableTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
@Test
public void testAllFilesPresentInSuspend() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/debug/localVariables/suspend"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/debug/localVariables/suspend/simple.kt");
}
}
}