Add ability to ignore test for backend w/o checks

It used for the tests from this commit becouse they was failing during setup.
This commit is contained in:
Zalim Bashorov
2016-11-07 19:58:12 +03:00
parent a27572af49
commit af4ec9815b
5 changed files with 27 additions and 28 deletions
@@ -233,10 +233,18 @@ public final class InTextDirectivesUtils {
return backends.isEmpty() || backends.contains(targetBackend.name());
}
public static boolean isIgnoredTarget(TargetBackend targetBackend, File file) {
private static boolean isIgnoredTargetByPrefix(TargetBackend targetBackend, File file, String prefix) {
if (targetBackend == TargetBackend.ANY) return false;
List<String> ignoredBackends = findLinesWithPrefixesRemoved(textWithDirectives(file), "// IGNORE_BACKEND: ");
List<String> ignoredBackends = findLinesWithPrefixesRemoved(textWithDirectives(file), prefix);
return ignoredBackends.contains(targetBackend.name());
}
public static boolean isIgnoredTarget(TargetBackend targetBackend, File file) {
return isIgnoredTargetByPrefix(targetBackend, file, "// IGNORE_BACKEND: ");
}
public static boolean isIgnoredTargetWithoutCheck(TargetBackend targetBackend, File file) {
return isIgnoredTargetByPrefix(targetBackend, file, "// IGNORE_BACKEND_WITHOUT_CHECK: ");
}
}