From e8115820ddaa227a327a8b51e9d08d519b039016 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Thu, 7 Sep 2023 15:12:02 +0200 Subject: [PATCH] LV 2.0: mute CompilerOutputTest.testReleaseCompilerAgainstPreReleaseLibrary Related to KT-61773 --- .../konan/blackboxtest/AbstractNativeSimpleTest.kt | 13 +++++++++++++ .../kotlin/konan/blackboxtest/CompilerOutputTest.kt | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/AbstractNativeSimpleTest.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/AbstractNativeSimpleTest.kt index 9b18648958c..d8b3e455a97 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/AbstractNativeSimpleTest.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/AbstractNativeSimpleTest.kt @@ -12,12 +12,25 @@ import org.jetbrains.kotlin.konan.blackboxtest.support.runner.TestExecutable import org.jetbrains.kotlin.konan.blackboxtest.support.runner.TestRunners.createProperTestRunner import org.jetbrains.kotlin.konan.blackboxtest.support.settings.SimpleTestRunSettings import org.junit.jupiter.api.extension.ExtendWith +import kotlin.test.fail @ExtendWith(NativeSimpleTestSupport::class) abstract class AbstractNativeSimpleTest { internal lateinit var testRunSettings: SimpleTestRunSettings internal lateinit var testRunProvider: SimpleTestRunProvider + fun muteForK2(isK2: Boolean, test: () -> Unit) { + if (!isK2) { + return test() + } + try { + test() + } catch (e: Throwable) { + return + } + fail("Looks like this test can be unmuted. Remove the call to `muteForK2`.") + } + internal fun runExecutableAndVerify(testCase: TestCase, executable: TestExecutable) { val testRun = testRunProvider.getTestRun(testCase, executable) val testRunner = createProperTestRunner(testRun, testRunSettings) diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/CompilerOutputTest.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/CompilerOutputTest.kt index a25e24261af..1da953c85ed 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/CompilerOutputTest.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/CompilerOutputTest.kt @@ -14,6 +14,7 @@ import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.LibraryCompil import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationArtifact import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationResult import org.jetbrains.kotlin.konan.blackboxtest.support.compilation.TestCompilationResult.Companion.assertSuccess +import org.jetbrains.kotlin.konan.blackboxtest.support.settings.PipelineType import org.jetbrains.kotlin.test.KotlinTestUtils import org.junit.jupiter.api.Test import java.io.File @@ -21,8 +22,10 @@ import java.io.File @TestDataPath("\$PROJECT_ROOT") @EnforcedProperty(ClassLevelProperty.COMPILER_OUTPUT_INTERCEPTOR, "NONE") class CompilerOutputTest : AbstractNativeSimpleTest() { + + // TODO: unmute after fix of KT-61773 @Test - fun testReleaseCompilerAgainstPreReleaseLibrary() { + fun testReleaseCompilerAgainstPreReleaseLibrary() = muteForK2(isK2 = testRunSettings.get() == PipelineType.K2) { // We intentionally use JS testdata, because the compilers should behave the same way in such a test. // To be refactored later, after CompileKotlinAgainstCustomBinariesTest.testReleaseCompilerAgainstPreReleaseLibraryJs is fixed. val rootDir = File("compiler/testData/compileKotlinAgainstCustomBinaries/releaseCompilerAgainstPreReleaseLibraryJs")