diff --git a/tests/osproc/tafalse.nim b/tests/osproc/tafalse.nim new file mode 100644 index 0000000000..24fd4fb2e6 --- /dev/null +++ b/tests/osproc/tafalse.nim @@ -0,0 +1,3 @@ +# 'tafalse.nim' to ensure it is compiled before texitcode.nim +import system +quit(QuitFailure) diff --git a/tests/osproc/texitcode.nim b/tests/osproc/texitcode.nim index df1db8aa3b..1e83658c21 100644 --- a/tests/osproc/texitcode.nim +++ b/tests/osproc/texitcode.nim @@ -4,14 +4,14 @@ discard """ """ import osproc, os -const filename = when defined(Windows): "tfalse.exe" else: "tfalse" +const filename = when defined(Windows): "tafalse.exe" else: "tafalse" +let dir = getCurrentDir() / "tests" / "osproc" +doAssert fileExists(dir / filename) -doAssert fileExists(getCurrentDir() / "tests" / "osproc" / filename) - -var p = startProcess(filename, getCurrentDir() / "tests" / "osproc") +var p = startProcess(filename, dir) doAssert(waitForExit(p) == QuitFailure) -p = startProcess(filename, getCurrentDir() / "tests" / "osproc") +p = startProcess(filename, dir) var running = true while running: running = running(p) diff --git a/tests/osproc/tfalse.nim b/tests/osproc/tfalse.nim deleted file mode 100644 index a2c5e259db..0000000000 --- a/tests/osproc/tfalse.nim +++ /dev/null @@ -1,2 +0,0 @@ -import system -quit(QuitFailure)