diff --git a/compiler/testData/codegen/box/annotations/instances/annotationToString.kt b/compiler/testData/codegen/box/annotations/instances/annotationToString.kt index f1002fac613..29cdba1c1c1 100644 --- a/compiler/testData/codegen/box/annotations/instances/annotationToString.kt +++ b/compiler/testData/codegen/box/annotations/instances/annotationToString.kt @@ -2,6 +2,11 @@ // IGNORE_BACKEND: WASM // 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 // !LANGUAGE: +InstantiationOfAnnotationClasses diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/group/ExtTestCaseGroupProvider.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/group/ExtTestCaseGroupProvider.kt index 3db94e961e6..ad969094857 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/group/ExtTestCaseGroupProvider.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/group/ExtTestCaseGroupProvider.kt @@ -77,7 +77,7 @@ internal class ExtTestCaseGroupProvider : TestCaseGroupProvider, TestDisposable( if (extTestDataFile.isRelevant) testCases += extTestDataFile.createTestCase( - definitelyStandaloneTest = settings.get().value || testDataFile in standalones, + definitelyStandaloneTest = settings.get().value, sharedModules = sharedModules ) else @@ -87,14 +87,6 @@ internal class ExtTestCaseGroupProvider : TestCaseGroupProvider, TestDisposable( TestCaseGroup.Default(disabledTestCaseIds, testCases) } } - - companion object { - /** Tests that should be compiled and executed as standalone tests. */ - private val standalones: Set = 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( @@ -176,6 +168,8 @@ private class ExtTestDataFile( * - test is compiled independently of any other tests */ private fun determineIfStandaloneTest(): Boolean = with(structure) { + if (directives.contains(NATIVE_STANDALONE_DIRECTIVE)) return true + var isStandaloneTest = false filesToTransform.forEach { handler -> @@ -589,6 +583,8 @@ private class ExtTestDataFile( private const val EXPECT_ACTUAL_LINKER_DIRECTIVE = "EXPECT_ACTUAL_LINKER" 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 val OPT_INS_PURELY_FOR_COMPILER = setOf( OptInNames.REQUIRES_OPT_IN_FQ_NAME.asString()