From 5500f80d0b38dacf0e3a46e08a1733550788eb0c Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Tue, 8 Nov 2016 14:28:53 +0300 Subject: [PATCH] Support ignoring by target backend for single generated classes --- .../org/jetbrains/kotlin/test/KotlinTestUtils.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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); }