From 59142b3051259d1a30c359d76d26f2c465a8030d Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Tue, 2 Jan 2024 14:30:18 +0100 Subject: [PATCH] [K/N][tests] Fix using `objcnames` package in grouped tests Native test infra groups individual tests into compilations, so it renames packages, patching package and import directives, to avoid clashes. This doesn't include "standard" packages. They are distinguished by a predicate defined in the test infra. This predicate didn't include `objcnames.*` -- synthetic package provided by the compiler. As a result, tests importing from `objcnames.*` got those import directives patched, which was unexpected and could make tests fail. This commit fixes the problem, making `objnames.*` recognized as a "standard" package. --- .../test/blackbox/support/group/ExtTestCaseGroupProvider.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/group/ExtTestCaseGroupProvider.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/group/ExtTestCaseGroupProvider.kt index f313ffbe29d..1e195521ba6 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/group/ExtTestCaseGroupProvider.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/group/ExtTestCaseGroupProvider.kt @@ -321,6 +321,7 @@ private class ExtTestDataFile( || importedFqName.startsWith(KOTLINX_PACKAGE_NAME) || importedFqName.startsWith(HELPERS_PACKAGE_NAME) || importedFqName.startsWith(CNAMES_PACKAGE_NAME) + || importedFqName.startsWith(OBJCNAMES_PACKAGE_NAME) || importedFqName.startsWith(PLATFORM_PACKAGE_NAME) ) { return @@ -615,6 +616,7 @@ private class ExtTestDataFile( private val HELPERS_PACKAGE_NAME = Name.identifier("helpers") private val KOTLINX_PACKAGE_NAME = Name.identifier("kotlinx") private val CNAMES_PACKAGE_NAME = Name.identifier("cnames") + private val OBJCNAMES_PACKAGE_NAME = Name.identifier("objcnames") private val PLATFORM_PACKAGE_NAME = Name.identifier("platform") private val MANDATORY_SOURCE_TRANSFORMERS: ExternalSourceTransformers = listOf(DiagnosticsRemovingSourceTransformer)