[K/N] Support ignoring test with legacy mm
This commit is contained in:
committed by
Space Team
parent
0f589dac34
commit
0506d39d8a
@@ -23,6 +23,7 @@ enum class TargetBackend(
|
|||||||
ANDROID(false, JVM),
|
ANDROID(false, JVM),
|
||||||
ANDROID_IR(true, JVM_IR),
|
ANDROID_IR(true, JVM_IR),
|
||||||
NATIVE(true),
|
NATIVE(true),
|
||||||
|
NATIVE_WITH_LEGACY_MM(true, NATIVE),
|
||||||
JVM_WITH_OLD_EVALUATOR(false),
|
JVM_WITH_OLD_EVALUATOR(false),
|
||||||
JVM_IR_WITH_OLD_EVALUATOR(true),
|
JVM_IR_WITH_OLD_EVALUATOR(true),
|
||||||
JVM_WITH_IR_EVALUATOR(false),
|
JVM_WITH_IR_EVALUATOR(false),
|
||||||
|
|||||||
@@ -2839,7 +2839,7 @@ standaloneTest("exception_in_global_init") {
|
|||||||
enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
||||||
source = "runtime/exceptions/exception_in_global_init.kt"
|
source = "runtime/exceptions/exception_in_global_init.kt"
|
||||||
expectedExitStatusChecker = { it != 0 }
|
expectedExitStatusChecker = { it != 0 }
|
||||||
outputChecker = { s -> s.contains("Uncaught Kotlin exception: kotlin.IllegalStateException: FAIL") && !s.contains("in kotlin main") }
|
outputChecker = { s -> s.contains("Uncaught Kotlin exception:") && s.coinains("FAIL") && !s.contains("in kotlin main") }
|
||||||
}
|
}
|
||||||
|
|
||||||
task rethrow_exception(type: KonanLocalTest) {
|
task rethrow_exception(type: KonanLocalTest) {
|
||||||
|
|||||||
+9
-6
@@ -74,7 +74,8 @@ internal class ExtTestCaseGroupProvider : TestCaseGroupProvider, TestDisposable(
|
|||||||
generatedSources = settings.get(),
|
generatedSources = settings.get(),
|
||||||
customKlibs = settings.get(),
|
customKlibs = settings.get(),
|
||||||
pipelineType = settings.get(),
|
pipelineType = settings.get(),
|
||||||
timeouts = settings.get()
|
timeouts = settings.get(),
|
||||||
|
memoryModel = settings.get(),
|
||||||
)
|
)
|
||||||
|
|
||||||
if (extTestDataFile.isRelevant)
|
if (extTestDataFile.isRelevant)
|
||||||
@@ -99,7 +100,8 @@ private class ExtTestDataFile(
|
|||||||
private val generatedSources: GeneratedSources,
|
private val generatedSources: GeneratedSources,
|
||||||
private val customKlibs: CustomKlibs,
|
private val customKlibs: CustomKlibs,
|
||||||
private val pipelineType: PipelineType,
|
private val pipelineType: PipelineType,
|
||||||
private val timeouts: Timeouts
|
private val timeouts: Timeouts,
|
||||||
|
private val memoryModel: MemoryModel
|
||||||
) {
|
) {
|
||||||
private val structure by lazy {
|
private val structure by lazy {
|
||||||
val allSourceTransformers: ExternalSourceTransformers = if (customSourceTransformers.isNullOrEmpty())
|
val allSourceTransformers: ExternalSourceTransformers = if (customSourceTransformers.isNullOrEmpty())
|
||||||
@@ -138,17 +140,18 @@ private class ExtTestDataFile(
|
|||||||
|
|
||||||
val isRelevant: Boolean =
|
val isRelevant: Boolean =
|
||||||
isCompatibleTarget(TargetBackend.NATIVE, testDataFile) // Checks TARGET_BACKEND/DONT_TARGET_EXACT_BACKEND directives.
|
isCompatibleTarget(TargetBackend.NATIVE, testDataFile) // Checks TARGET_BACKEND/DONT_TARGET_EXACT_BACKEND directives.
|
||||||
&& !isIgnoredNativeTarget(pipelineType, testDataFile) // Checks IGNORE_BACKEND directives.
|
&& !isIgnoredTarget(pipelineType, testDataFile, TargetBackend.NATIVE) // Checks IGNORE_BACKEND directives.
|
||||||
|
&& (memoryModel != MemoryModel.LEGACY || !isIgnoredTarget(pipelineType, testDataFile, TargetBackend.NATIVE_WITH_LEGACY_MM)) // Checks IGNORE_BACKEND directives.
|
||||||
&& testDataFileSettings.languageSettings.none { it in INCOMPATIBLE_LANGUAGE_SETTINGS }
|
&& testDataFileSettings.languageSettings.none { it in INCOMPATIBLE_LANGUAGE_SETTINGS }
|
||||||
&& INCOMPATIBLE_DIRECTIVES.none { it in structure.directives }
|
&& INCOMPATIBLE_DIRECTIVES.none { it in structure.directives }
|
||||||
&& structure.directives[API_VERSION_DIRECTIVE] !in INCOMPATIBLE_API_VERSIONS
|
&& structure.directives[API_VERSION_DIRECTIVE] !in INCOMPATIBLE_API_VERSIONS
|
||||||
&& structure.directives[LANGUAGE_VERSION_DIRECTIVE] !in INCOMPATIBLE_LANGUAGE_VERSIONS
|
&& structure.directives[LANGUAGE_VERSION_DIRECTIVE] !in INCOMPATIBLE_LANGUAGE_VERSIONS
|
||||||
|
|
||||||
private fun isIgnoredNativeTarget(pipelineType: PipelineType, testDataFile: File): Boolean {
|
private fun isIgnoredTarget(pipelineType: PipelineType, testDataFile: File, backend: TargetBackend): Boolean {
|
||||||
return when (pipelineType) {
|
return when (pipelineType) {
|
||||||
PipelineType.K1 ->
|
PipelineType.K1 ->
|
||||||
isIgnoredTarget(
|
isIgnoredTarget(
|
||||||
TargetBackend.NATIVE,
|
backend,
|
||||||
testDataFile,
|
testDataFile,
|
||||||
/*includeAny = */true,
|
/*includeAny = */true,
|
||||||
IGNORE_BACKEND_DIRECTIVE_PREFIX,
|
IGNORE_BACKEND_DIRECTIVE_PREFIX,
|
||||||
@@ -156,7 +159,7 @@ private class ExtTestDataFile(
|
|||||||
)
|
)
|
||||||
PipelineType.K2 ->
|
PipelineType.K2 ->
|
||||||
isIgnoredTarget(
|
isIgnoredTarget(
|
||||||
TargetBackend.NATIVE,
|
backend,
|
||||||
testDataFile,
|
testDataFile,
|
||||||
/*includeAny = */true,
|
/*includeAny = */true,
|
||||||
IGNORE_BACKEND_DIRECTIVE_PREFIX,
|
IGNORE_BACKEND_DIRECTIVE_PREFIX,
|
||||||
|
|||||||
Reference in New Issue
Block a user