Remove muted tests on automatic experimental->release coroutine migration
This commit is contained in:
@@ -1,70 +0,0 @@
|
|||||||
// FILE: A.kt
|
|
||||||
// !LANGUAGE: -ReleaseCoroutines
|
|
||||||
// TODO: Unmute when automatic conversion experimental <-> release will be implemented
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE, JVM_IR, JS_IR
|
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.*
|
|
||||||
|
|
||||||
var callback: (() -> Unit)? = null
|
|
||||||
fun join() {
|
|
||||||
while (callback != null) {
|
|
||||||
val x = callback!!
|
|
||||||
callback = null
|
|
||||||
x()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun builder1(c: suspend () -> String): String {
|
|
||||||
var res = "FAIL"
|
|
||||||
c.startCoroutine(object : Continuation<String> {
|
|
||||||
override val context = EmptyCoroutineContext
|
|
||||||
override fun resume(value: String) {
|
|
||||||
res = value
|
|
||||||
}
|
|
||||||
override fun resumeWithException(exception: Throwable) {
|
|
||||||
throw exception
|
|
||||||
}
|
|
||||||
})
|
|
||||||
join()
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
fun builder2(c: suspend String.() -> String): String {
|
|
||||||
var res = "FAIL"
|
|
||||||
c.startCoroutine("O", object : Continuation<String> {
|
|
||||||
override val context = EmptyCoroutineContext
|
|
||||||
override fun resume(value: String) {
|
|
||||||
res = value
|
|
||||||
}
|
|
||||||
override fun resumeWithException(exception: Throwable) {
|
|
||||||
throw exception
|
|
||||||
}
|
|
||||||
})
|
|
||||||
join()
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
// FILE: B.kt
|
|
||||||
|
|
||||||
import kotlin.coroutines.*
|
|
||||||
import kotlin.coroutines.intrinsics.*
|
|
||||||
|
|
||||||
suspend fun ok(): String {
|
|
||||||
return o() + k()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun o(): String = suspendCoroutine { continuation ->
|
|
||||||
callback = { continuation.resume("O") }
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun k(): String = suspendCoroutine { continuation ->
|
|
||||||
callback = { continuation.resume("K") }
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
if (builder1(::ok) != "OK") return "FAIL 1"
|
|
||||||
if (builder1 { ok() } != "OK") return "FAIL 2"
|
|
||||||
|
|
||||||
if (builder2 { this + k() } != "OK") return "FAIL 5"
|
|
||||||
return "OK"
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
// FILE: A.kt
|
|
||||||
// !LANGUAGE: -ReleaseCoroutines
|
|
||||||
// TODO: Unmute when automatic conversion experimental <-> release will be implemented
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE, JVM_IR, JS_IR
|
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.*
|
|
||||||
|
|
||||||
var callback: (() -> Unit)? = null
|
|
||||||
fun join() {
|
|
||||||
while (callback != null) {
|
|
||||||
val x = callback!!
|
|
||||||
callback = null
|
|
||||||
x()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun (suspend () -> String).builder(): String {
|
|
||||||
var res = "FAIL"
|
|
||||||
startCoroutine(object : Continuation<String> {
|
|
||||||
override val context = EmptyCoroutineContext
|
|
||||||
override fun resume(value: String) {
|
|
||||||
res = value
|
|
||||||
}
|
|
||||||
override fun resumeWithException(exception: Throwable) {
|
|
||||||
throw exception
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
join()
|
|
||||||
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
// FILE: B.kt
|
|
||||||
|
|
||||||
import kotlin.coroutines.*
|
|
||||||
import kotlin.coroutines.intrinsics.*
|
|
||||||
|
|
||||||
suspend fun ok(): String {
|
|
||||||
return o() + k()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun o(): String = suspendCoroutine { continuation ->
|
|
||||||
callback = { continuation.resume("O") }
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun k(): String = suspendCoroutine { continuation ->
|
|
||||||
callback = { continuation.resume("K") }
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
if ((::ok).builder() != "OK") return "FAIL 1"
|
|
||||||
if (suspend { ok() }.builder() != "OK") return "FAIL 2"
|
|
||||||
return "OK"
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
// FILE: A.kt
|
|
||||||
// !LANGUAGE: -ReleaseCoroutines
|
|
||||||
// TODO: Unmute when automatic conversion experimental <-> release will be implemented
|
|
||||||
// IGNORE_BACKEND: JS, NATIVE, JVM_IR, JS_IR
|
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.*
|
|
||||||
import kotlin.coroutines.experimental.intrinsics.*
|
|
||||||
|
|
||||||
var callback: (() -> Unit)? = null
|
|
||||||
suspend fun dummy(): String = suspendCoroutine {
|
|
||||||
callback = { it.resume("OK") }
|
|
||||||
}
|
|
||||||
|
|
||||||
// FILE: B.kt
|
|
||||||
|
|
||||||
import kotlin.coroutines.*
|
|
||||||
import kotlin.coroutines.intrinsics.*
|
|
||||||
|
|
||||||
fun builder(x: suspend () -> Unit) {
|
|
||||||
x.startCoroutine(object : Continuation<Any?> {
|
|
||||||
override val context: CoroutineContext = EmptyCoroutineContext
|
|
||||||
|
|
||||||
override fun resumeWith(result: Result<Any?>) {
|
|
||||||
result.getOrThrow()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
while (callback != null) {
|
|
||||||
val x = callback!!
|
|
||||||
callback = null
|
|
||||||
x()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
var res = "fail"
|
|
||||||
|
|
||||||
builder {
|
|
||||||
res = dummy()
|
|
||||||
}
|
|
||||||
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
-28
@@ -338,34 +338,6 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl
|
|||||||
runTest("compiler/testData/compileKotlinAgainstKotlin/unsignedTypesInAnnotations.kt");
|
runTest("compiler/testData/compileKotlinAgainstKotlin/unsignedTypesInAnnotations.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/compileKotlinAgainstKotlin/coroutines")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class Coroutines extends AbstractCompileKotlinAgainstKotlinTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInCoroutines() throws Exception {
|
|
||||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileKotlinAgainstKotlin/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("builder.kt")
|
|
||||||
public void testBuilder() throws Exception {
|
|
||||||
runTest("compiler/testData/compileKotlinAgainstKotlin/coroutines/builder.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("receiver.kt")
|
|
||||||
public void testReceiver() throws Exception {
|
|
||||||
runTest("compiler/testData/compileKotlinAgainstKotlin/coroutines/receiver.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("simple.kt")
|
|
||||||
public void testSimple() throws Exception {
|
|
||||||
runTest("compiler/testData/compileKotlinAgainstKotlin/coroutines/simple.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/compileKotlinAgainstKotlin/jvm8")
|
@TestMetadata("compiler/testData/compileKotlinAgainstKotlin/jvm8")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
Generated
-28
@@ -333,34 +333,6 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile
|
|||||||
runTest("compiler/testData/compileKotlinAgainstKotlin/unsignedTypesInAnnotations.kt");
|
runTest("compiler/testData/compileKotlinAgainstKotlin/unsignedTypesInAnnotations.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/compileKotlinAgainstKotlin/coroutines")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class Coroutines extends AbstractIrCompileKotlinAgainstKotlinTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInCoroutines() throws Exception {
|
|
||||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileKotlinAgainstKotlin/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("builder.kt")
|
|
||||||
public void testBuilder() throws Exception {
|
|
||||||
runTest("compiler/testData/compileKotlinAgainstKotlin/coroutines/builder.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("receiver.kt")
|
|
||||||
public void testReceiver() throws Exception {
|
|
||||||
runTest("compiler/testData/compileKotlinAgainstKotlin/coroutines/receiver.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("simple.kt")
|
|
||||||
public void testSimple() throws Exception {
|
|
||||||
runTest("compiler/testData/compileKotlinAgainstKotlin/coroutines/simple.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/compileKotlinAgainstKotlin/jvm8")
|
@TestMetadata("compiler/testData/compileKotlinAgainstKotlin/jvm8")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
Reference in New Issue
Block a user