Disable generation of 1.2 coroutine tests for JS_IR

Add directive DONT_TARGET_EXACT_BACKEND.
This directive is needed to exclude JS_IR backned but keep "compatible"
JS backend.
This commit is contained in:
Svyatoslav Kuzmich
2019-01-27 02:47:42 +03:00
parent ab3eb06a62
commit b49ec3edb8
10 changed files with 15 additions and 42 deletions
@@ -221,6 +221,10 @@ public final class InTextDirectivesUtils {
public static boolean isCompatibleTarget(TargetBackend targetBackend, File file) {
if (targetBackend == TargetBackend.ANY) return true;
List<String> doNotTarget = findLinesWithPrefixesRemoved(textWithDirectives(file), "// DONT_TARGET_EXACT_BACKEND: ");
if (doNotTarget.contains(targetBackend.name()))
return false;
List<String> backends = findLinesWithPrefixesRemoved(textWithDirectives(file), "// TARGET_BACKEND: ");
return backends.isEmpty() || backends.contains(targetBackend.name()) || backends.contains(targetBackend.getCompatibleWith().name());
}