[K/N][test] Ignore stdlib test in new infra

This commit is contained in:
Pavel Punegov
2022-01-13 18:06:24 +03:00
committed by Space
parent f724b5c29d
commit 6f323dd33a
5 changed files with 14 additions and 5 deletions
@@ -27,7 +27,8 @@ import org.junit.jupiter.api.TestFactory
"kotlin-native/backend.native/tests/stdlib_external/text/**.kt", "kotlin-native/backend.native/tests/stdlib_external/text/**.kt",
"kotlin-native/backend.native/tests/stdlib_external/utils.kt", "kotlin-native/backend.native/tests/stdlib_external/utils.kt",
"kotlin-native/backend.native/tests/stdlib_external/jsCollectionFactoriesActuals.kt" "kotlin-native/backend.native/tests/stdlib_external/jsCollectionFactoriesActuals.kt"
] ],
ignoredTests = [DISABLED_STDLIB_TEST]
), ),
TC( TC(
name = "nativeStdlibInWorker", name = "nativeStdlibInWorker",
@@ -39,7 +40,8 @@ import org.junit.jupiter.api.TestFactory
"kotlin-native/backend.native/tests/stdlib_external/text/**.kt", "kotlin-native/backend.native/tests/stdlib_external/text/**.kt",
"kotlin-native/backend.native/tests/stdlib_external/utils.kt", "kotlin-native/backend.native/tests/stdlib_external/utils.kt",
"kotlin-native/backend.native/tests/stdlib_external/jsCollectionFactoriesActuals.kt" "kotlin-native/backend.native/tests/stdlib_external/jsCollectionFactoriesActuals.kt"
] ],
ignoredTests = [DISABLED_STDLIB_TEST]
), ),
TC( TC(
name = "kotlinTest", name = "kotlinTest",
@@ -71,3 +73,4 @@ class StdlibTest : AbstractNativeBlackBoxTest() {
private const val ENABLE_MPP = "-Xmulti-platform" private const val ENABLE_MPP = "-Xmulti-platform"
private const val STDLIB_IS_A_FRIEND = "-friend-modules=$KOTLIN_NATIVE_DISTRIBUTION/klib/common/stdlib" private const val STDLIB_IS_A_FRIEND = "-friend-modules=$KOTLIN_NATIVE_DISTRIBUTION/klib/common/stdlib"
private const val ENABLE_X_STDLIB_API = "-opt-in=kotlin.RequiresOptIn,kotlin.ExperimentalStdlibApi" private const val ENABLE_X_STDLIB_API = "-opt-in=kotlin.RequiresOptIn,kotlin.ExperimentalStdlibApi"
private const val DISABLED_STDLIB_TEST = "test.collections.CollectionTest.abstractCollectionToArray"
@@ -178,7 +178,7 @@ internal class TestCase(
) { ) {
sealed interface Extras sealed interface Extras
class NoTestRunnerExtras(val entryPoint: String, val inputDataFile: File?) : Extras class NoTestRunnerExtras(val entryPoint: String, val inputDataFile: File?) : Extras
class WithTestRunnerExtras(val runnerType: TestRunnerType) : Extras class WithTestRunnerExtras(val runnerType: TestRunnerType, val ignoredTests: Set<String> = emptySet()) : Extras
init { init {
when (kind) { when (kind) {
@@ -210,6 +210,8 @@ internal class TestRunProvider(
private fun Collection<TestName>.filterIrrelevant(testCase: TestCase) = private fun Collection<TestName>.filterIrrelevant(testCase: TestCase) =
if (testCase.kind == TestKind.REGULAR) if (testCase.kind == TestKind.REGULAR)
filter { testName -> testName.packageName.startsWith(testCase.nominalPackageName) } filter { testName -> testName.packageName.startsWith(testCase.nominalPackageName) }
else if (testCase.extras is WithTestRunnerExtras)
filterNot { testName -> testCase.extras<WithTestRunnerExtras>().ignoredTests.contains(testName.toString()) }
else else
this this
@@ -62,7 +62,10 @@ internal class PredefinedTestCaseGroupProvider(annotation: PredefinedTestCases)
.parseCompilerArgs(settings) { "Failed to parse free compiler arguments for test case $testCaseId" }, .parseCompilerArgs(settings) { "Failed to parse free compiler arguments for test case $testCaseId" },
nominalPackageName = PackageName(testCaseId.uniqueName), nominalPackageName = PackageName(testCaseId.uniqueName),
expectedOutputDataFile = null, expectedOutputDataFile = null,
extras = WithTestRunnerExtras(runnerType = predefinedTestCase.runnerType) extras = WithTestRunnerExtras(
runnerType = predefinedTestCase.runnerType,
ignoredTests = predefinedTestCase.ignoredTests.toSet()
)
) )
testCase.initialize(null) testCase.initialize(null)
@@ -17,7 +17,8 @@ internal annotation class PredefinedTestCase(
val name: String, val name: String,
val runnerType: TestRunnerType, val runnerType: TestRunnerType,
val freeCompilerArgs: Array<String>, val freeCompilerArgs: Array<String>,
val sourceLocations: Array<String> val sourceLocations: Array<String>,
val ignoredTests: Array<String> = []
) )
internal object PredefinedPaths { internal object PredefinedPaths {