[K/N][test] LLDB tests should run only on host target
* Use EnforceHostTarget for the LldbTestGenerated * Exclude test in provider if run with non-host target Merge-request: KT-MR-8964
This commit is contained in:
committed by
Space Team
parent
60f43d6d4f
commit
7fa7118325
+9
-1
@@ -9,6 +9,7 @@ import org.jetbrains.kotlin.generators.generateTestGroupSuiteWithJUnit5
|
||||
import org.jetbrains.kotlin.generators.model.annotation
|
||||
import org.jetbrains.kotlin.konan.blackboxtest.*
|
||||
import org.jetbrains.kotlin.konan.blackboxtest.support.ClassLevelProperty
|
||||
import org.jetbrains.kotlin.konan.blackboxtest.support.EnforcedHostTarget
|
||||
import org.jetbrains.kotlin.konan.blackboxtest.support.EnforcedProperty
|
||||
import org.jetbrains.kotlin.konan.blackboxtest.support.group.K2Pipeline
|
||||
import org.jetbrains.kotlin.konan.blackboxtest.support.group.UseExtTestCaseGroupProvider
|
||||
@@ -122,7 +123,12 @@ fun main() {
|
||||
testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
|
||||
testClass<AbstractNativeBlackBoxTest>(
|
||||
suiteTestClassName = "LldbTestGenerated",
|
||||
annotations = listOf(debugger(), provider<UseStandardTestCaseGroupProvider>(), debugOnly())
|
||||
annotations = listOf(
|
||||
debugger(),
|
||||
provider<UseStandardTestCaseGroupProvider>(),
|
||||
debugOnly(),
|
||||
hostOnly()
|
||||
)
|
||||
) {
|
||||
model("lldb")
|
||||
}
|
||||
@@ -138,6 +144,8 @@ private fun debugOnly() = annotation(
|
||||
"propertyValue" to "DEBUG"
|
||||
)
|
||||
|
||||
private fun hostOnly() = provider<EnforcedHostTarget>()
|
||||
|
||||
private fun codegen() = annotation(Tag::class.java, "codegen")
|
||||
private fun codegenK2() = annotation(Tag::class.java, "codegenK2")
|
||||
private fun debugger() = annotation(Tag::class.java, "debugger")
|
||||
|
||||
+3
-1
@@ -50,7 +50,9 @@ internal class StandardTestCaseGroupProvider : TestCaseGroupProvider {
|
||||
|
||||
val lldbTestCases = testCases.filter { it.kind == TestKind.STANDALONE_LLDB }
|
||||
if (lldbTestCases.isNotEmpty()
|
||||
&& (settings.get<OptimizationMode>() != OptimizationMode.DEBUG || !settings.get<LLDB>().isAvailable)
|
||||
&& (settings.get<OptimizationMode>() != OptimizationMode.DEBUG
|
||||
|| !settings.get<LLDB>().isAvailable
|
||||
|| settings.get<KotlinNativeTargets>().areDifferentTargets())
|
||||
) {
|
||||
lldbTestCases.mapTo(disabledTestCaseIds) { it.id }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user