summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-10-09 19:03:12 +0200
committerGitHub <noreply@github.com>2016-10-09 19:03:12 +0200
commitf46168d65465c705fbc0a9d51ea3d25c3bba7706 (patch)
tree91e3bab86150f598eba86a6555bd70dc6e8f3306 /tests
parent00b749c41810efe8169e5eeaea932ee63024738d (diff)
parent7f25db2dd1dfbcb22b0a432efd56b522272eeede (diff)
downloadNim-f46168d65465c705fbc0a9d51ea3d25c3bba7706.tar.gz
Merge pull request #4828 from jfhg/unify_waitpid_handling
Unify waitpid handling
Diffstat (limited to 'tests')
-rw-r--r--tests/osproc/tafalse.nim3
-rw-r--r--tests/osproc/texitcode.nim18
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/osproc/tafalse.nim b/tests/osproc/tafalse.nim
new file mode 100644
index 000000000..24fd4fb2e
--- /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
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)