JVM: Make coroutines spilling tests runtime

instead of bytecode text ones. Check the content of continuation
object instead of bytecode, since this is less prone to changes during
changes in coroutines codegen.

 #KT-48678
This commit is contained in:
Ilmir Usmanov
2022-06-23 02:55:50 +02:00
parent 62d7094ac5
commit f34ae686a0
27 changed files with 728 additions and 309 deletions
@@ -9715,6 +9715,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
public void testSafeCallElvis() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/varSpilling/safeCallElvis.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/coroutines/varSpilling/cleanup")
@TestDataPath("$PROJECT_ROOT")
public class Cleanup {
@Test
public void testAllFilesPresentInCleanup() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/varSpilling/cleanup"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
}
}
}
}
@@ -9757,6 +9757,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
public void testSafeCallElvis() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/varSpilling/safeCallElvis.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/coroutines/varSpilling/cleanup")
@TestDataPath("$PROJECT_ROOT")
public class Cleanup {
@Test
public void testAllFilesPresentInCleanup() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/varSpilling/cleanup"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
}
}
}
@@ -8624,6 +8624,19 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
public void testSafeCallElvis() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/varSpilling/safeCallElvis.kt");
}
@TestMetadata("compiler/testData/codegen/box/coroutines/varSpilling/cleanup")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Cleanup extends AbstractIrCodegenBoxWasmTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath);
}
public void testAllFilesPresentInCleanup() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/varSpilling/cleanup"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
}
}
}