From d50b0693b2ad5d6f7896f4eb11183d71c0f70094 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Thu, 9 Jun 2022 14:36:40 +0300 Subject: [PATCH] [Native][tests] Don't make typeOf tests standalone The test engine detected tests using typeOf and made them "standalone", i.e. disabled test grouping and thus package renaming for them, to keep the reflection information intact. Now, with `ReflectionPackageName` annotation, this is not required anymore. --- .../support/group/ExtTestCaseGroupProvider.kt | 12 ------------ 1 file changed, 12 deletions(-) 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 3ab0f7ee51e..3db94e961e6 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 @@ -189,18 +189,6 @@ private class ExtTestDataFile( } else -> super.visitKtFile(file) } - - override fun visitCallExpression(expression: KtCallExpression) = when { - isStandaloneTest -> Unit - expression.getChildOfType()?.getReferencedNameAsName() == TYPE_OF_NAME -> { - // Found a call of `typeOf()` function. It means that this is most likely a reflection-oriented test - // that might compare the obtained name of a type against some string literal (ex: "foo.Bar"), - // which is obviously not patched during package names patching step because this step is not so smart. - // So, let's avoid patching package names for this test and let's run it in standalone mode. - isStandaloneTest = true - } - else -> super.visitCallExpression(expression) - } }) }