Skip to content

Commit 4ff9957

Browse files
committed
made test root lookup more intelligent
1 parent 6df1fcb commit 4ff9957

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

soot-infoflow/test/soot/jimple/infoflow/test/junit/JUnitTests.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,18 @@ protected void onlyForwards(IInfoflow infoflow, String message) {
200200
*/
201201
public static File getInfoflowRoot() {
202202
File testRoot = new File(".");
203-
if (!new File(testRoot, "src").exists())
204-
testRoot = new File(testRoot, "soot-infoflow");
203+
204+
if (!new File(testRoot, "src").exists()) {
205+
// Try a subfolder
206+
File subFolder = new File(testRoot, "soot-infoflow");
207+
if (subFolder.exists())
208+
testRoot = subFolder;
209+
else {
210+
// Try a sibling folder
211+
testRoot = new File(testRoot.getParentFile(), "soot-infoflow");
212+
}
213+
}
214+
205215
if (!new File(testRoot, "src").exists())
206216
throw new RuntimeException(String.format("Test root not found in %s", testRoot.getAbsolutePath()));
207217
return testRoot;

0 commit comments

Comments
 (0)