diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt index 68b882d51cc..b3f2c7bc318 100644 --- a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt @@ -203,6 +203,7 @@ open class FrameworkTest : DefaultTask(), KonanTestExecutable { val timeoutMessage = if (exitCode == -1) { "WARNING: probably a timeout\n" } else "" - check(exitCode == (expectedExitStatus ?: 0)) { "${timeoutMessage}Execution of $testExecName failed with exit code: $exitCode " } + val expectedExitCode = expectedExitStatus?.takeUnless { project.compileOnlyTests } ?: 0 + check(exitCode == expectedExitCode) { "${timeoutMessage}Execution of $testExecName failed with exit code: $exitCode (expected exit code: $expectedExitCode)" } } }