[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
@@ -21,7 +21,13 @@ abstract class AbstractBytecodeListingTest : CodegenTestCase() {
val actualTxt = BytecodeListingTextCollectingVisitor.getText(
classFileFactory,
withSignatures = isWithSignatures(wholeFile),
withAnnotations = isWithAnnotations(wholeFile)
withAnnotations = isWithAnnotations(wholeFile),
filter = object : BytecodeListingTextCollectingVisitor.Filter {
override fun shouldWriteClass(access: Int, name: String): Boolean = !name.startsWith("helpers/")
override fun shouldWriteMethod(access: Int, name: String, desc: String): Boolean = true
override fun shouldWriteField(access: Int, name: String, desc: String): Boolean = true
override fun shouldWriteInnerClass(name: String): Boolean = true
}
)
val prefixes = when {
@@ -65,6 +65,7 @@ import static org.jetbrains.kotlin.codegen.TestUtilsKt.extractUrls;
import static org.jetbrains.kotlin.test.KotlinTestUtils.getAnnotationsJar;
import static org.jetbrains.kotlin.test.clientserver.TestProcessServerKt.getBoxMethodOrNull;
import static org.jetbrains.kotlin.test.clientserver.TestProcessServerKt.getGeneratedClass;
import static org.jetbrains.kotlin.test.clientserver.TestProcessServerKt.runBoxMethod;
public abstract class CodegenTestCase extends KotlinBaseTest<KotlinBaseTest.TestFile> {
private static final String DEFAULT_TEST_FILE_NAME = "a_test";
@@ -679,7 +680,7 @@ public abstract class CodegenTestCase extends KotlinBaseTest<KotlinBaseTest.Test
Thread.currentThread().setContextClassLoader(classLoader);
}
try {
result = (String) method.invoke(null);
result = runBoxMethod(method);
}
finally {
if (savedClassLoader != classLoader) {