提交 e024628d 编写于 作者: S Skylot

chore: fix directory search for smali tests

上级 6428f293
......@@ -68,7 +68,7 @@ public abstract class SmaliTest extends IntegrationTest {
} else {
smaliFilesDir = pkg + File.separatorChar + testDir + File.separatorChar;
}
File smaliDir = new File(SMALI_TESTS_DIR, smaliFilesDir);
File smaliDir = getSmaliDir(smaliFilesDir);
String[] smaliFileNames = smaliDir.list((dir, name) -> name.endsWith(".smali"));
assertThat("Smali files not found in " + smaliDir, smaliFileNames, notNullValue());
return Stream.of(smaliFileNames)
......@@ -87,4 +87,16 @@ public abstract class SmaliTest extends IntegrationTest {
}
throw new AssertionError("Smali file not found: " + smaliFile.getPath());
}
private static File getSmaliDir(String baseName) {
File smaliDir = new File(SMALI_TESTS_DIR, baseName);
if (smaliDir.exists()) {
return smaliDir;
}
File pathFromRoot = new File(SMALI_TESTS_PROJECT, smaliDir.getPath());
if (pathFromRoot.exists()) {
return pathFromRoot;
}
throw new AssertionError("Smali dir not found: " + smaliDir.getPath());
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册