diff --git a/compiler/tests-common/org/jetbrains/kotlin/test/KotlinTestUtils.java b/compiler/tests-common/org/jetbrains/kotlin/test/KotlinTestUtils.java index 858457fbb11..ea1f929cc83 100644 --- a/compiler/tests-common/org/jetbrains/kotlin/test/KotlinTestUtils.java +++ b/compiler/tests-common/org/jetbrains/kotlin/test/KotlinTestUtils.java @@ -91,6 +91,8 @@ import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; +import static org.jetbrains.kotlin.test.InTextDirectivesUtils.isCompatibleTarget; + public class KotlinTestUtils { public static String TEST_MODULE_NAME = "test-module"; @@ -847,7 +849,7 @@ public class KotlinTestUtils { assertTestClassPresentByMetadata(testCaseClass, file); } } - else if (filenamePattern.matcher(file.getName()).matches() && InTextDirectivesUtils.isCompatibleTarget(targetBackend, file)) { + else if (filenamePattern.matcher(file.getName()).matches() && isCompatibleTarget(targetBackend, file)) { assertFilePathPresent(file, rootFile, filePaths); } } @@ -857,7 +859,8 @@ public class KotlinTestUtils { public static void assertAllTestsPresentInSingleGeneratedClass( @NotNull Class testCaseClass, @NotNull File testDataDir, - @NotNull final Pattern filenamePattern + @NotNull final Pattern filenamePattern, + @NotNull final TargetBackend targetBackend ) { final File rootFile = new File(getTestsRoot(testCaseClass)); @@ -866,7 +869,7 @@ public class KotlinTestUtils { FileUtil.processFilesRecursively(testDataDir, new Processor() { @Override public boolean process(File file) { - if (file.isFile() && filenamePattern.matcher(file.getName()).matches()) { + if (file.isFile() && filenamePattern.matcher(file.getName()).matches() && isCompatibleTarget(targetBackend, file)) { assertFilePathPresent(file, rootFile, filePaths); }