[K/N][Tests] Move threadStates tests to common codegen/box folder

^KT-61259
This commit is contained in:
Vladimir Sukharev
2024-01-16 19:31:48 +01:00
committed by Space Team
parent 96d7dc4fa6
commit 80cf88c9b9
30 changed files with 465 additions and 162 deletions
@@ -1,51 +0,0 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// TARGET_BACKEND: NATIVE
// FREE_COMPILER_ARGS: -opt-in=kotlin.native.internal.InternalForKotlinNative
// MODULE: cinterop
// FILE: threadStates.def
language = C
---
void assertNativeThreadState();
void runCallback(void(*callback)(void)) {
assertNativeThreadState();
callback();
assertNativeThreadState();
}
// FILE: threadStates.cpp
#include <stdio.h>
#include <stdlib.h>
// Implemented in the runtime for test purposes.
extern "C" bool Kotlin_Debugging_isThreadStateNative();
extern "C" void assertNativeThreadState() {
if (!Kotlin_Debugging_isThreadStateNative()) {
printf("Incorrect thread state. Expected native thread state.");
abort();
}
}
// MODULE: main(cinterop)
// FILE: main.kt
@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlin.native.runtime.Debugging
import kotlin.test.*
import kotlinx.cinterop.*
import threadStates.*
fun main() {
runCallback(staticCFunction { ->
assertRunnableThreadState()
})
assertRunnableThreadState()
}
fun assertRunnableThreadState() {
assertTrue(Debugging.isThreadStateRunnable)
}
@@ -1,40 +0,0 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// TARGET_BACKEND: NATIVE
// FREE_COMPILER_ARGS: -opt-in=kotlin.native.internal.InternalForKotlinNative
// MODULE: cinterop
// FILE: threadStates.def
language = C
---
void runInNewThread(void(*callback)(void));
// FILE: threadStates.cpp
#include <thread>
extern "C" void runInNewThread(void(*callback)(void)) {
std::thread t([callback]() {
callback();
});
t.join();
}
// MODULE: main(cinterop)
// FILE: main.kt
@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlin.native.runtime.Debugging
import kotlin.test.*
import kotlinx.cinterop.*
import threadStates.*
fun main() {
runInNewThread(staticCFunction { ->
assertRunnableThreadState()
})
}
fun assertRunnableThreadState() {
assertTrue(Debugging.isThreadStateRunnable)
}
@@ -1,64 +0,0 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// TARGET_BACKEND: NATIVE
// FREE_COMPILER_ARGS: -opt-in=kotlin.native.internal.InternalForKotlinNative
// MODULE: cinterop
// FILE: threadStates.def
language = C
---
void assertNativeThreadState();
void runCallback(void(*callback)(void)) {
assertNativeThreadState();
callback();
assertNativeThreadState();
}
// FILE: threadStates.cpp
#include <stdio.h>
#include <stdlib.h>
// Implemented in the runtime for test purposes.
extern "C" bool Kotlin_Debugging_isThreadStateNative();
extern "C" void assertNativeThreadState() {
if (!Kotlin_Debugging_isThreadStateNative()) {
printf("Incorrect thread state. Expected native thread state.");
abort();
}
}
// MODULE: main(cinterop)
// FILE: main.kt
@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlin.native.runtime.Debugging
import kotlin.test.*
import kotlinx.cinterop.staticCFunction
import threadStates.*
fun main() {
try {
runCallback(staticCFunction(::throwException))
} catch (e: CustomException) {
assertRunnableThreadState()
return
} catch (e: Throwable) {
assertRunnableThreadState()
fail("Wrong exception type: ${e.message}")
}
fail("No exception thrown")
}
fun assertRunnableThreadState() {
assertTrue(Debugging.isThreadStateRunnable)
}
class CustomException() : Exception()
fun throwException() {
assertRunnableThreadState()
throw CustomException()
}
@@ -1,63 +0,0 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// TARGET_BACKEND: NATIVE
// FREE_COMPILER_ARGS: -opt-in=kotlin.native.internal.InternalForKotlinNative
// MODULE: cinterop
// FILE: threadStates.def
language = C
---
void assertNativeThreadState();
void runCallback(void(*callback)(void)) {
assertNativeThreadState();
callback();
assertNativeThreadState();
}
// FILE: threadStates.cpp
#include <stdio.h>
#include <stdlib.h>
// Implemented in the runtime for test purposes.
extern "C" bool Kotlin_Debugging_isThreadStateNative();
extern "C" void assertNativeThreadState() {
if (!Kotlin_Debugging_isThreadStateNative()) {
printf("Incorrect thread state. Expected native thread state.");
abort();
}
}
// MODULE: main(cinterop)
// FILE: main.kt
@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlin.native.runtime.Debugging
import kotlin.test.*
import kotlinx.cinterop.staticCFunction
import threadStates.*
fun main() {
try {
runCallback(staticCFunction(::throwException))
} catch (e: CustomException) {
assertRunnableThreadState()
return
} finally {
assertRunnableThreadState()
}
fail("No exception thrown")
}
fun assertRunnableThreadState() {
assertTrue(Debugging.isThreadStateRunnable)
}
class CustomException() : Exception()
fun throwException() {
assertRunnableThreadState()
throw CustomException()
}
@@ -1,62 +0,0 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// TARGET_BACKEND: NATIVE
// FREE_COMPILER_ARGS: -opt-in=kotlin.native.internal.InternalForKotlinNative
// MODULE: cinterop
// FILE: threadStates.def
language = C
---
void assertNativeThreadState();
void runCallback(void(*callback)(void)) {
assertNativeThreadState();
callback();
assertNativeThreadState();
}
// FILE: threadStates.cpp
#include <stdio.h>
#include <stdlib.h>
// Implemented in the runtime for test purposes.
extern "C" bool Kotlin_Debugging_isThreadStateNative();
extern "C" void assertNativeThreadState() {
if (!Kotlin_Debugging_isThreadStateNative()) {
printf("Incorrect thread state. Expected native thread state.");
abort();
}
}
// MODULE: main(cinterop)
// FILE: main.kt
@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlin.native.runtime.Debugging
import kotlin.test.*
import kotlinx.cinterop.staticCFunction
import threadStates.*
fun main() {
try {
try {
runCallback(staticCFunction(::throwException))
} finally {
assertRunnableThreadState()
}
assertRunnableThreadState()
} catch (_: CustomException) {}
}
fun assertRunnableThreadState() {
assertTrue(Debugging.isThreadStateRunnable)
}
class CustomException() : Exception()
fun throwException() {
assertRunnableThreadState()
throw CustomException()
}
@@ -1,24 +0,0 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// TARGET_BACKEND: NATIVE
// FREE_COMPILER_ARGS: -opt-in=kotlin.native.internal.InternalForKotlinNative
@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlin.native.runtime.Debugging
import kotlin.test.*
import kotlinx.cinterop.*
fun main() {
val funPtr = staticCFunction { ->
assertRunnableThreadState()
}
assertRunnableThreadState()
funPtr()
assertRunnableThreadState()
}
fun assertRunnableThreadState() {
assertTrue(Debugging.isThreadStateRunnable)
}
@@ -1,50 +0,0 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// TARGET_BACKEND: NATIVE
// FREE_COMPILER_ARGS: -opt-in=kotlin.native.internal.InternalForKotlinNative
// MODULE: cinterop
// FILE: threadStates.def
language = C
---
#include <stdint.h>
void assertNativeThreadState();
int32_t answer() {
assertNativeThreadState();
return 42;
}
// FILE: threadStates.cpp
#include <stdio.h>
#include <stdlib.h>
// Implemented in the runtime for test purposes.
extern "C" bool Kotlin_Debugging_isThreadStateNative();
extern "C" void assertNativeThreadState() {
if (!Kotlin_Debugging_isThreadStateNative()) {
printf("Incorrect thread state. Expected native thread state.");
abort();
}
}
// MODULE: main(cinterop)
// FILE: main.kt
@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlin.native.runtime.Debugging
import kotlin.test.*
import kotlinx.cinterop.*
import threadStates.*
fun main() {
answer()
assertRunnableThreadState()
}
fun assertRunnableThreadState() {
assertTrue(Debugging.isThreadStateRunnable)
}
@@ -1,67 +0,0 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// TARGET_BACKEND: NATIVE
// FREE_COMPILER_ARGS: -opt-in=kotlin.native.internal.InternalForKotlinNative
// MODULE: cinterop
// FILE: threadStates.def
language = C
---
void assertNativeThreadState();
void runCallback(void(*callback)(void)) {
assertNativeThreadState();
callback();
assertNativeThreadState();
}
// FILE: threadStates.cpp
#include <stdio.h>
#include <stdlib.h>
// Implemented in the runtime for test purposes.
extern "C" bool Kotlin_Debugging_isThreadStateNative();
extern "C" void assertNativeThreadState() {
if (!Kotlin_Debugging_isThreadStateNative()) {
printf("Incorrect thread state. Expected native thread state.");
abort();
}
}
// MODULE: main(cinterop)
// FILE: main.kt
@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlin.native.runtime.Debugging
import kotlin.test.*
import kotlinx.cinterop.staticCFunction
import threadStates.*
fun main() {
try {
runCallback(staticCFunction { ->
assertRunnableThreadState()
runCallback(staticCFunction(::throwException))
})
} catch (e: CustomException) {
assertRunnableThreadState()
return
} catch (e: Throwable) {
assertRunnableThreadState()
fail("Wrong exception type: ${e.message}")
}
fail("No exception thrown")
}
fun assertRunnableThreadState() {
assertTrue(Debugging.isThreadStateRunnable)
}
class CustomException() : Exception()
fun throwException() {
assertRunnableThreadState()
throw CustomException()
}
@@ -1,66 +0,0 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// TARGET_BACKEND: NATIVE
// FREE_COMPILER_ARGS: -opt-in=kotlin.native.internal.InternalForKotlinNative
// MODULE: cinterop
// FILE: threadStates.def
language = C
---
void assertNativeThreadState();
void runCallback(void(*callback)(void)) {
assertNativeThreadState();
callback();
assertNativeThreadState();
}
// FILE: threadStates.cpp
#include <stdio.h>
#include <stdlib.h>
// Implemented in the runtime for test purposes.
extern "C" bool Kotlin_Debugging_isThreadStateNative();
extern "C" void assertNativeThreadState() {
if (!Kotlin_Debugging_isThreadStateNative()) {
printf("Incorrect thread state. Expected native thread state.");
abort();
}
}
// MODULE: main(cinterop)
// FILE: main.kt
@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlin.native.runtime.Debugging
import kotlin.test.*
import kotlinx.cinterop.staticCFunction
import threadStates.*
fun main() {
try {
runCallback(staticCFunction { ->
assertRunnableThreadState()
runCallback(staticCFunction(::throwException))
})
} catch (e: CustomException) {
assertRunnableThreadState()
return
} finally {
assertRunnableThreadState()
}
fail("No exception thrown")
}
fun assertRunnableThreadState() {
assertTrue(Debugging.isThreadStateRunnable)
}
class CustomException() : Exception()
fun throwException() {
assertRunnableThreadState()
throw CustomException()
}
@@ -1,60 +0,0 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// TARGET_BACKEND: NATIVE
// FREE_COMPILER_ARGS: -opt-in=kotlin.native.internal.InternalForKotlinNative
// MODULE: cinterop
// FILE: threadStates.def
language = C
---
#include <stdint.h>
void assertNativeThreadState();
void runCallback(void(*callback)(void)) {
assertNativeThreadState();
callback();
assertNativeThreadState();
}
int32_t answer() {
assertNativeThreadState();
return 42;
}
// FILE: threadStates.cpp
#include <stdio.h>
#include <stdlib.h>
// Implemented in the runtime for test purposes.
extern "C" bool Kotlin_Debugging_isThreadStateNative();
extern "C" void assertNativeThreadState() {
if (!Kotlin_Debugging_isThreadStateNative()) {
printf("Incorrect thread state. Expected native thread state.");
abort();
}
}
// MODULE: main(cinterop)
// FILE: main.kt
@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlin.native.runtime.Debugging
import kotlin.test.*
import kotlinx.cinterop.*
import threadStates.*
fun main() {
runCallback(staticCFunction { ->
assertRunnableThreadState()
answer()
Unit
})
assertRunnableThreadState()
}
fun assertRunnableThreadState() {
assertTrue(Debugging.isThreadStateRunnable)
}
@@ -5092,6 +5092,79 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
runTest("compiler/testData/codegen/box/cinterop/packages/root.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/cinterop/threadStates")
@TestDataPath("$PROJECT_ROOT")
@Tag("frontend-fir")
@FirPipeline()
@UseExtTestCaseGroupProvider()
public class ThreadStates {
@Test
public void testAllFilesPresentInThreadStates() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/cinterop/threadStates"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
@Test
@TestMetadata("callback.kt")
public void testCallback() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callback.kt");
}
@Test
@TestMetadata("callbackOnSeparateThread.kt")
public void testCallbackOnSeparateThread() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackOnSeparateThread.kt");
}
@Test
@TestMetadata("callbackWithException.kt")
public void testCallbackWithException() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackWithException.kt");
}
@Test
@TestMetadata("callbackWithFinally.kt")
public void testCallbackWithFinally() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackWithFinally.kt");
}
@Test
@TestMetadata("callbackWithFinallyNoCatch.kt")
public void testCallbackWithFinallyNoCatch() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackWithFinallyNoCatch.kt");
}
@Test
@TestMetadata("directStaticCFunctionCall.kt")
public void testDirectStaticCFunctionCall() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/directStaticCFunctionCall.kt");
}
@Test
@TestMetadata("nativeCall.kt")
public void testNativeCall() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nativeCall.kt");
}
@Test
@TestMetadata("nestedCallbackWithException.kt")
public void testNestedCallbackWithException() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nestedCallbackWithException.kt");
}
@Test
@TestMetadata("nestedCallbackWithFinally.kt")
public void testNestedCallbackWithFinally() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nestedCallbackWithFinally.kt");
}
@Test
@TestMetadata("nestedCalls.kt")
public void testNestedCalls() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nestedCalls.kt");
}
}
}
@Nested
@@ -5208,6 +5208,81 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
runTest("compiler/testData/codegen/box/cinterop/packages/root.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/cinterop/threadStates")
@TestDataPath("$PROJECT_ROOT")
@Tag("frontend-fir")
@FirPipeline()
@UseExtTestCaseGroupProvider()
@UsePartialLinkage(mode = Mode.DISABLED)
@Tag("no-partial-linkage-may-be-skipped")
public class ThreadStates {
@Test
public void testAllFilesPresentInThreadStates() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/cinterop/threadStates"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
@Test
@TestMetadata("callback.kt")
public void testCallback() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callback.kt");
}
@Test
@TestMetadata("callbackOnSeparateThread.kt")
public void testCallbackOnSeparateThread() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackOnSeparateThread.kt");
}
@Test
@TestMetadata("callbackWithException.kt")
public void testCallbackWithException() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackWithException.kt");
}
@Test
@TestMetadata("callbackWithFinally.kt")
public void testCallbackWithFinally() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackWithFinally.kt");
}
@Test
@TestMetadata("callbackWithFinallyNoCatch.kt")
public void testCallbackWithFinallyNoCatch() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackWithFinallyNoCatch.kt");
}
@Test
@TestMetadata("directStaticCFunctionCall.kt")
public void testDirectStaticCFunctionCall() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/directStaticCFunctionCall.kt");
}
@Test
@TestMetadata("nativeCall.kt")
public void testNativeCall() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nativeCall.kt");
}
@Test
@TestMetadata("nestedCallbackWithException.kt")
public void testNestedCallbackWithException() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nestedCallbackWithException.kt");
}
@Test
@TestMetadata("nestedCallbackWithFinally.kt")
public void testNestedCallbackWithFinally() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nestedCallbackWithFinally.kt");
}
@Test
@TestMetadata("nestedCalls.kt")
public void testNestedCalls() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nestedCalls.kt");
}
}
}
@Nested
@@ -258,79 +258,4 @@ public class FirNativeStandaloneTestGenerated extends AbstractNativeBlackBoxTest
runTest("native/native.tests/testData/standalone/termination/unhandledExceptionInForeignThread.kt");
}
}
@Nested
@TestMetadata("native/native.tests/testData/standalone/threadStates")
@TestDataPath("$PROJECT_ROOT")
@Tag("standalone")
@EnforcedProperty(property = ClassLevelProperty.TEST_KIND, propertyValue = "STANDALONE_NO_TR")
@UseStandardTestCaseGroupProvider()
@Tag("frontend-fir")
@FirPipeline()
public class ThreadStates {
@Test
public void testAllFilesPresentInThreadStates() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("native/native.tests/testData/standalone/threadStates"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("callback.kt")
public void testCallback() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/callback.kt");
}
@Test
@TestMetadata("callbackOnSeparateThread.kt")
public void testCallbackOnSeparateThread() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/callbackOnSeparateThread.kt");
}
@Test
@TestMetadata("callbackWithException.kt")
public void testCallbackWithException() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/callbackWithException.kt");
}
@Test
@TestMetadata("callbackWithFinally.kt")
public void testCallbackWithFinally() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/callbackWithFinally.kt");
}
@Test
@TestMetadata("callbackWithFinallyNoCatch.kt")
public void testCallbackWithFinallyNoCatch() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/callbackWithFinallyNoCatch.kt");
}
@Test
@TestMetadata("directStaticCFunctionCall.kt")
public void testDirectStaticCFunctionCall() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/directStaticCFunctionCall.kt");
}
@Test
@TestMetadata("nativeCall.kt")
public void testNativeCall() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/nativeCall.kt");
}
@Test
@TestMetadata("nestedCallbackWithException.kt")
public void testNestedCallbackWithException() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/nestedCallbackWithException.kt");
}
@Test
@TestMetadata("nestedCallbackWithFinally.kt")
public void testNestedCallbackWithFinally() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/nestedCallbackWithFinally.kt");
}
@Test
@TestMetadata("nestedCalls.kt")
public void testNestedCalls() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/nestedCalls.kt");
}
}
}
@@ -4976,6 +4976,77 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
runTest("compiler/testData/codegen/box/cinterop/packages/root.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/cinterop/threadStates")
@TestDataPath("$PROJECT_ROOT")
@UseExtTestCaseGroupProvider()
public class ThreadStates {
@Test
public void testAllFilesPresentInThreadStates() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/cinterop/threadStates"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
@Test
@TestMetadata("callback.kt")
public void testCallback() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callback.kt");
}
@Test
@TestMetadata("callbackOnSeparateThread.kt")
public void testCallbackOnSeparateThread() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackOnSeparateThread.kt");
}
@Test
@TestMetadata("callbackWithException.kt")
public void testCallbackWithException() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackWithException.kt");
}
@Test
@TestMetadata("callbackWithFinally.kt")
public void testCallbackWithFinally() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackWithFinally.kt");
}
@Test
@TestMetadata("callbackWithFinallyNoCatch.kt")
public void testCallbackWithFinallyNoCatch() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackWithFinallyNoCatch.kt");
}
@Test
@TestMetadata("directStaticCFunctionCall.kt")
public void testDirectStaticCFunctionCall() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/directStaticCFunctionCall.kt");
}
@Test
@TestMetadata("nativeCall.kt")
public void testNativeCall() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nativeCall.kt");
}
@Test
@TestMetadata("nestedCallbackWithException.kt")
public void testNestedCallbackWithException() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nestedCallbackWithException.kt");
}
@Test
@TestMetadata("nestedCallbackWithFinally.kt")
public void testNestedCallbackWithFinally() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nestedCallbackWithFinally.kt");
}
@Test
@TestMetadata("nestedCalls.kt")
public void testNestedCalls() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nestedCalls.kt");
}
}
}
@Nested
@@ -5093,6 +5093,79 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
runTest("compiler/testData/codegen/box/cinterop/packages/root.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/cinterop/threadStates")
@TestDataPath("$PROJECT_ROOT")
@UseExtTestCaseGroupProvider()
@UsePartialLinkage(mode = Mode.DISABLED)
@Tag("no-partial-linkage-may-be-skipped")
public class ThreadStates {
@Test
public void testAllFilesPresentInThreadStates() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/cinterop/threadStates"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
}
@Test
@TestMetadata("callback.kt")
public void testCallback() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callback.kt");
}
@Test
@TestMetadata("callbackOnSeparateThread.kt")
public void testCallbackOnSeparateThread() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackOnSeparateThread.kt");
}
@Test
@TestMetadata("callbackWithException.kt")
public void testCallbackWithException() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackWithException.kt");
}
@Test
@TestMetadata("callbackWithFinally.kt")
public void testCallbackWithFinally() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackWithFinally.kt");
}
@Test
@TestMetadata("callbackWithFinallyNoCatch.kt")
public void testCallbackWithFinallyNoCatch() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/callbackWithFinallyNoCatch.kt");
}
@Test
@TestMetadata("directStaticCFunctionCall.kt")
public void testDirectStaticCFunctionCall() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/directStaticCFunctionCall.kt");
}
@Test
@TestMetadata("nativeCall.kt")
public void testNativeCall() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nativeCall.kt");
}
@Test
@TestMetadata("nestedCallbackWithException.kt")
public void testNestedCallbackWithException() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nestedCallbackWithException.kt");
}
@Test
@TestMetadata("nestedCallbackWithFinally.kt")
public void testNestedCallbackWithFinally() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nestedCallbackWithFinally.kt");
}
@Test
@TestMetadata("nestedCalls.kt")
public void testNestedCalls() throws Exception {
runTest("compiler/testData/codegen/box/cinterop/threadStates/nestedCalls.kt");
}
}
}
@Nested
@@ -249,77 +249,4 @@ public class NativeStandaloneTestGenerated extends AbstractNativeBlackBoxTest {
runTest("native/native.tests/testData/standalone/termination/unhandledExceptionInForeignThread.kt");
}
}
@Nested
@TestMetadata("native/native.tests/testData/standalone/threadStates")
@TestDataPath("$PROJECT_ROOT")
@Tag("standalone")
@EnforcedProperty(property = ClassLevelProperty.TEST_KIND, propertyValue = "STANDALONE_NO_TR")
@UseStandardTestCaseGroupProvider()
public class ThreadStates {
@Test
public void testAllFilesPresentInThreadStates() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("native/native.tests/testData/standalone/threadStates"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("callback.kt")
public void testCallback() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/callback.kt");
}
@Test
@TestMetadata("callbackOnSeparateThread.kt")
public void testCallbackOnSeparateThread() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/callbackOnSeparateThread.kt");
}
@Test
@TestMetadata("callbackWithException.kt")
public void testCallbackWithException() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/callbackWithException.kt");
}
@Test
@TestMetadata("callbackWithFinally.kt")
public void testCallbackWithFinally() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/callbackWithFinally.kt");
}
@Test
@TestMetadata("callbackWithFinallyNoCatch.kt")
public void testCallbackWithFinallyNoCatch() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/callbackWithFinallyNoCatch.kt");
}
@Test
@TestMetadata("directStaticCFunctionCall.kt")
public void testDirectStaticCFunctionCall() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/directStaticCFunctionCall.kt");
}
@Test
@TestMetadata("nativeCall.kt")
public void testNativeCall() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/nativeCall.kt");
}
@Test
@TestMetadata("nestedCallbackWithException.kt")
public void testNestedCallbackWithException() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/nestedCallbackWithException.kt");
}
@Test
@TestMetadata("nestedCallbackWithFinally.kt")
public void testNestedCallbackWithFinally() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/nestedCallbackWithFinally.kt");
}
@Test
@TestMetadata("nestedCalls.kt")
public void testNestedCalls() throws Exception {
runTest("native/native.tests/testData/standalone/threadStates/nestedCalls.kt");
}
}
}