Skip to content

Commit d390e9c

Browse files
committed
TestFoundation: don't always change TestURL test directory on Android
The working directory is changed to /data/local/tmp on Android assuming that adb is being used, but this isn't necessary in the Termux app.
1 parent edce8ca commit d390e9c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

TestFoundation/TestURL.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,9 @@ class TestURL : XCTestCase {
340340
}
341341

342342
#if os(Android)
343-
FileManager.default.changeCurrentDirectoryPath("/data/local/tmp")
343+
if (ProcessInfo.processInfo.environment["PREFIX"]?.hasPrefix("/data/data/com.termux") == false) {
344+
FileManager.default.changeCurrentDirectoryPath("/data/local/tmp")
345+
}
344346
#endif
345347

346348
let cwd = FileManager.default.currentDirectoryPath

0 commit comments

Comments
 (0)