Suppress tests marked by TARGET_BACKEND directive when running Android codegen tests
This commit is contained in:
+19
@@ -243,6 +243,10 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
|
||||
else {
|
||||
String fullFileText = FileUtil.loadFile(file, true);
|
||||
|
||||
if (!hasJvmBackendTarget(fullFileText)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//TODO: support multifile facades
|
||||
//TODO: support multifile facades hierarchies
|
||||
if (hasBoxMethod(fullFileText)) {
|
||||
@@ -268,6 +272,21 @@ public class CodegenTestsOnAndroidGenerator extends KtUsefulTestCase {
|
||||
return text.contains("fun box()");
|
||||
}
|
||||
|
||||
private static boolean hasJvmBackendTarget(String text) {
|
||||
List<String> backends = InTextDirectivesUtils.findLinesWithPrefixesRemoved(text, "// TARGET_BACKEND: ");
|
||||
if (backends.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (String backend : backends) {
|
||||
if (backend.equals("JVM")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void generateTestMethod(Printer p, String testName, String className, String filePath) {
|
||||
p.println("public void test" + testName + "() throws Exception {");
|
||||
p.pushIndent();
|
||||
|
||||
Reference in New Issue
Block a user