[K/N][tests] Migrate termination runtime tests to new testing infra ^KT-61259
This commit is contained in:
committed by
Space Team
parent
226ee3c367
commit
04a2a2d90d
+18
@@ -0,0 +1,18 @@
|
||||
// EXIT_CODE: !0
|
||||
// FREE_COMPILER_ARGS: -opt-in=kotlin.native.internal.InternalForKotlinNative
|
||||
// OUTPUT_REGEX: value true: Error\. Runnable state: true\nUncaught Kotlin exception: kotlin\.Error: an error\n.*
|
||||
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class)
|
||||
|
||||
import kotlin.native.runtime.Debugging
|
||||
import kotlin.test.*
|
||||
|
||||
fun customExceptionHook(throwable: Throwable) {
|
||||
println("value ${getUnhandledExceptionHook() == ::customExceptionHook}: ${throwable::class.simpleName}. Runnable state: ${Debugging.isThreadStateRunnable}")
|
||||
}
|
||||
|
||||
fun main() {
|
||||
val x = 42
|
||||
setUnhandledExceptionHook(::customExceptionHook)
|
||||
|
||||
throw Error("an error")
|
||||
}
|
||||
Reference in New Issue
Block a user