[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.
This commit is contained in:
Svyatoslav Scherbina
2024-01-02 14:30:18 +01:00
committed by Space Team
parent ffb0b063a8
commit 59142b3051
@@ -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)