[Tests] Don't silently ignore tests failes on 1st phase of backward testing ^KT-71957
diff --git a/compiler/testData/codegen/box/annotations/instances/rearrangedArgumentsInAnnotationCall.kt b/compiler/testData/codegen/box/annotations/instances/rearrangedArgumentsInAnnotationCall.kt index 1638586..9e5fef5 100644 --- a/compiler/testData/codegen/box/annotations/instances/rearrangedArgumentsInAnnotationCall.kt +++ b/compiler/testData/codegen/box/annotations/instances/rearrangedArgumentsInAnnotationCall.kt
@@ -1,6 +1,7 @@ // ISSUE: KT-73845 // JVM_ABI_K1_K2_DIFF: K2 serializes annotation parameter default values (KT-59526). +// IGNORE_NATIVE: compatibilityTestMode=OldArtifactNewCompiler annotation class A annotation class B(
diff --git a/compiler/testData/codegen/box/classDelegation/delegationToStarProjectedType.kt b/compiler/testData/codegen/box/classDelegation/delegationToStarProjectedType.kt index da4ac80..82bc9fc 100644 --- a/compiler/testData/codegen/box/classDelegation/delegationToStarProjectedType.kt +++ b/compiler/testData/codegen/box/classDelegation/delegationToStarProjectedType.kt
@@ -1,4 +1,5 @@ // ISSUE: KT-72585 +// IGNORE_NATIVE: compatibilityTestMode=OldArtifactNewCompiler interface A<out T : Any> { fun foo(): String
diff --git a/compiler/testData/codegen/box/contracts/referenceToGenericInDeserializedContract.kt b/compiler/testData/codegen/box/contracts/referenceToGenericInDeserializedContract.kt index 3ab7a61..9b37d6c 100644 --- a/compiler/testData/codegen/box/contracts/referenceToGenericInDeserializedContract.kt +++ b/compiler/testData/codegen/box/contracts/referenceToGenericInDeserializedContract.kt
@@ -1,6 +1,7 @@ // IGNORE_BACKEND_K1: ANY // WITH_STDLIB // ISSUE: KT-76301 +// IGNORE_NATIVE: compatibilityTestMode=OldArtifactNewCompiler // MODULE: lib // FILE: lib.kt
diff --git a/compiler/testData/codegen/box/inference/pcla/issues/kt74819e.kt b/compiler/testData/codegen/box/inference/pcla/issues/kt74819e.kt index e3596bd..e661bf3 100644 --- a/compiler/testData/codegen/box/inference/pcla/issues/kt74819e.kt +++ b/compiler/testData/codegen/box/inference/pcla/issues/kt74819e.kt
@@ -1,5 +1,6 @@ // ISSUE: KT-74819 // WITH_STDLIB +// IGNORE_NATIVE: compatibilityTestMode=OldArtifactNewCompiler fun foo(x: List<String>) = buildList {
diff --git a/compiler/testData/codegen/box/inference/pcla/issues/kt76171.kt b/compiler/testData/codegen/box/inference/pcla/issues/kt76171.kt index 57f5b94..1d4199e 100644 --- a/compiler/testData/codegen/box/inference/pcla/issues/kt76171.kt +++ b/compiler/testData/codegen/box/inference/pcla/issues/kt76171.kt
@@ -1,5 +1,6 @@ // ISSUE: KT-76171 // WITH_STDLIB +// IGNORE_NATIVE: compatibilityTestMode=OldArtifactNewCompiler import kotlin.coroutines.Continuation import kotlin.coroutines.CoroutineContext
diff --git a/compiler/testData/codegen/box/typealias/callTypeAliasWithInnerRhsInStaticScope.kt b/compiler/testData/codegen/box/typealias/callTypeAliasWithInnerRhsInStaticScope.kt index 406ab0e..60dc9fa 100644 --- a/compiler/testData/codegen/box/typealias/callTypeAliasWithInnerRhsInStaticScope.kt +++ b/compiler/testData/codegen/box/typealias/callTypeAliasWithInnerRhsInStaticScope.kt
@@ -1,5 +1,6 @@ // DUMP_IR // ISSUE: KT-74107 +// IGNORE_NATIVE: compatibilityTestMode=OldArtifactNewCompiler class C { inner class Inner
diff --git a/compiler/testData/codegen/box/typealias/typeArgumentsMappingForTopLevelTAWithInnerRHS.kt b/compiler/testData/codegen/box/typealias/typeArgumentsMappingForTopLevelTAWithInnerRHS.kt index 066cf3c..a957d8f 100644 --- a/compiler/testData/codegen/box/typealias/typeArgumentsMappingForTopLevelTAWithInnerRHS.kt +++ b/compiler/testData/codegen/box/typealias/typeArgumentsMappingForTopLevelTAWithInnerRHS.kt
@@ -1,5 +1,6 @@ // DUMP_IR // ISSUE: KT-73454 +// IGNORE_NATIVE: compatibilityTestMode=OldArtifactNewCompiler class Foo<T> { inner class Inner(val p: String)
diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/AbstractNativeBlackBoxTest.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/AbstractNativeBlackBoxTest.kt index 4f9a003..aa3a394 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/AbstractNativeBlackBoxTest.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/AbstractNativeBlackBoxTest.kt
@@ -50,8 +50,10 @@ if (compatibilityTestMode == CompatibilityTestMode.OldArtifactNewCompiler) { ((e.failure.loggedData as? LoggedData.CompilationToolCall)?.input as? LoggedData.CompilerInput)?.let { if (it.isFirstPhase) { - // 1st phase of klib backward testing may fail, since old compiler not necessarily can compile newer code - return + reason = "Old compiler fails to compile a test into klib. Consider ignoring this test with:\n" + + "// IGNORE_NATIVE: compatibilityTestMode=${compatibilityTestMode.name}\n" + + "When unclear, which of grouped tests has caused the crash, use `-Pkotlin.internal.native.test.forceStandalone=true` Gradle parameter.\n" + + "Error was: $reason" } else { reason = possibleABICompatibilityIssueMessage( "current compiler fails to compile klib made by an older compiler.",
diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/group/IgnoreDisableHelper.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/group/IgnoreDisableHelper.kt index 4bc89bb..a89eed6 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/group/IgnoreDisableHelper.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/group/IgnoreDisableHelper.kt
@@ -48,17 +48,34 @@ } internal fun Settings.isDisabledByFutureFeature(languageSettings: Set<String>): Boolean { - if (get<CompatibilityTestMode>() == CompatibilityTestMode.None) - return false - val features = languageSettings.map { - LanguageFeature.valueOf(it.substring(1)) + return when (get<CompatibilityTestMode>()) { + CompatibilityTestMode.None -> false + CompatibilityTestMode.OldArtifactNewCompiler -> { + languageSettings.any { + val feature = LanguageFeature.valueOf(it.substring(1)) + when (val sinceVersion = feature.sinceVersion) { + null -> { + when (releasedCompilerVersion) { + LanguageVersion.KOTLIN_1_9 -> TODO("Insert here language features unsupported by Kotlin 1.9") + LanguageVersion.KOTLIN_2_0 -> TODO("Insert here language features unsupported by Kotlin 2.0") + LanguageVersion.KOTLIN_2_1 -> feature == LanguageFeature.NestedTypeAliases + || feature == LanguageFeature.ContextReceivers + || feature == LanguageFeature.ContextParameters + || feature == LanguageFeature.ExpectRefinement + || feature == LanguageFeature.FunctionalTypeWithExtensionAsSupertype + || feature == LanguageFeature.ContextSensitiveResolutionUsingExpectedType + || feature == LanguageFeature.UnnamedLocalVariables + || feature == LanguageFeature.IrInlinerBeforeKlibSerialization + LanguageVersion.KOTLIN_2_2 -> TODO("Insert here language features unsupported by Kotlin 2.2") + LanguageVersion.KOTLIN_2_3 -> TODO("Insert here language features unsupported by Kotlin 2.3") + else -> false + } + } + else -> sinceVersion > releasedCompilerVersion + } + } + } } - val any = features.any { feature -> - feature.sinceVersion?.let { - it > releasedCompilerVersion - } ?: (feature == LanguageFeature.ContextReceivers) - } - return any } // Note: this method would accept DISABLED_NATIVE without parameters as an unconditional test exclusion: don't even try to compile