[Native][tests] Introduce NATIVE_STANDALONE directive
This directive makes the test standalone, i.e. disables grouping it with other tests into a single compilation, and in particular disables package renaming for the test. Also, remove the old hard-coded way to mark tests standalone.
This commit is contained in:
@@ -2,6 +2,11 @@
|
|||||||
// IGNORE_BACKEND: WASM
|
// IGNORE_BACKEND: WASM
|
||||||
// DONT_TARGET_EXACT_BACKEND: JS
|
// DONT_TARGET_EXACT_BACKEND: JS
|
||||||
|
|
||||||
|
// This test fails on Native with test grouping and package renaming enabled,
|
||||||
|
// because the latter doesn't yet handle annotation toString implementations properly.
|
||||||
|
// Disable test grouping as a workaround:
|
||||||
|
// NATIVE_STANDALONE
|
||||||
|
|
||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
// !LANGUAGE: +InstantiationOfAnnotationClasses
|
// !LANGUAGE: +InstantiationOfAnnotationClasses
|
||||||
|
|
||||||
|
|||||||
+5
-9
@@ -77,7 +77,7 @@ internal class ExtTestCaseGroupProvider : TestCaseGroupProvider, TestDisposable(
|
|||||||
|
|
||||||
if (extTestDataFile.isRelevant)
|
if (extTestDataFile.isRelevant)
|
||||||
testCases += extTestDataFile.createTestCase(
|
testCases += extTestDataFile.createTestCase(
|
||||||
definitelyStandaloneTest = settings.get<ForcedStandaloneTestKind>().value || testDataFile in standalones,
|
definitelyStandaloneTest = settings.get<ForcedStandaloneTestKind>().value,
|
||||||
sharedModules = sharedModules
|
sharedModules = sharedModules
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
@@ -87,14 +87,6 @@ internal class ExtTestCaseGroupProvider : TestCaseGroupProvider, TestDisposable(
|
|||||||
TestCaseGroup.Default(disabledTestCaseIds, testCases)
|
TestCaseGroup.Default(disabledTestCaseIds, testCases)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
|
||||||
/** Tests that should be compiled and executed as standalone tests. */
|
|
||||||
private val standalones: Set<File> = listOf(
|
|
||||||
// Comparison of type information obtained with reflection against non-patched string literal:
|
|
||||||
"compiler/testData/codegen/box/annotations/instances/annotationToString.kt"
|
|
||||||
).mapToSet(::getAbsoluteFile)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ExtTestDataFile(
|
private class ExtTestDataFile(
|
||||||
@@ -176,6 +168,8 @@ private class ExtTestDataFile(
|
|||||||
* - test is compiled independently of any other tests
|
* - test is compiled independently of any other tests
|
||||||
*/
|
*/
|
||||||
private fun determineIfStandaloneTest(): Boolean = with(structure) {
|
private fun determineIfStandaloneTest(): Boolean = with(structure) {
|
||||||
|
if (directives.contains(NATIVE_STANDALONE_DIRECTIVE)) return true
|
||||||
|
|
||||||
var isStandaloneTest = false
|
var isStandaloneTest = false
|
||||||
|
|
||||||
filesToTransform.forEach { handler ->
|
filesToTransform.forEach { handler ->
|
||||||
@@ -589,6 +583,8 @@ private class ExtTestDataFile(
|
|||||||
private const val EXPECT_ACTUAL_LINKER_DIRECTIVE = "EXPECT_ACTUAL_LINKER"
|
private const val EXPECT_ACTUAL_LINKER_DIRECTIVE = "EXPECT_ACTUAL_LINKER"
|
||||||
private const val USE_EXPERIMENTAL_DIRECTIVE = "USE_EXPERIMENTAL"
|
private const val USE_EXPERIMENTAL_DIRECTIVE = "USE_EXPERIMENTAL"
|
||||||
|
|
||||||
|
private const val NATIVE_STANDALONE_DIRECTIVE = "NATIVE_STANDALONE"
|
||||||
|
|
||||||
private const val OPT_IN_DIRECTIVE = "OPT_IN"
|
private const val OPT_IN_DIRECTIVE = "OPT_IN"
|
||||||
private val OPT_INS_PURELY_FOR_COMPILER = setOf(
|
private val OPT_INS_PURELY_FOR_COMPILER = setOf(
|
||||||
OptInNames.REQUIRES_OPT_IN_FQ_NAME.asString()
|
OptInNames.REQUIRES_OPT_IN_FQ_NAME.asString()
|
||||||
|
|||||||
Reference in New Issue
Block a user