summary refs log tree commit diff stats
path: root/tests/osproc/texitcode.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/osproc/texitcode.nim')
-rw-r--r--tests/osproc/texitcode.nim18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/osproc/texitcode.nim b/tests/osproc/texitcode.nim
new file mode 100644
index 000000000..1e83658c2
--- /dev/null
+++ b/tests/osproc/texitcode.nim
@@ -0,0 +1,18 @@
+discard """
+  file: "texitcode.nim"
+  output: ""
+"""
+import osproc, os
+
+const filename = when defined(Windows): "tafalse.exe" else: "tafalse"
+let dir = getCurrentDir() / "tests" / "osproc"
+doAssert fileExists(dir / filename)
+
+var p = startProcess(filename, dir)
+doAssert(waitForExit(p) == QuitFailure)
+
+p = startProcess(filename, dir)
+var running = true
+while running:
+  running = running(p)
+doAssert(waitForExit(p) == QuitFailure)