summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Clarke <dan137clarke@gmail.com>2022-07-06 06:29:05 +1000
committerGitHub <noreply@github.com>2022-07-05 22:29:05 +0200
commit01b40dc1d7c7c5331361341bdf305084c799c05b (patch)
tree9ee56ed1bfeb0431445aafcdf649ef7e1d3aa902 /tests
parent7d0285853f4327a0a4f683e13971dc3429aad1f3 (diff)
downloadNim-01b40dc1d7c7c5331361341bdf305084c799c05b.tar.gz
Fixes return values of execCmd on macos (#19963)
* Fixes return values of execCmd on macos

* update tests to use existing structure

Co-authored-by: daniel <danielclarke@wearepopgun.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/tosproc.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/stdlib/tosproc.nim b/tests/stdlib/tosproc.nim
index c54e0d112..f55dd3e21 100644
--- a/tests/stdlib/tosproc.nim
+++ b/tests/stdlib/tosproc.nim
@@ -29,6 +29,12 @@ when defined(case_testfile): # compiled test file for child process
     case arg
     of "exit_0":
       if true: quit(0)
+    of "exit_1":
+      if true: quit(1)
+    of "exit_2":
+      if true: quit(2)
+    of "exit_42":
+      if true: quit(42)
     of "exitnow_139":
       if true: exitnow(139)
     of "c_exit2_139":
@@ -115,6 +121,13 @@ else: # main driver
     runTest("c_exit2_139", 139)
     runTest("quit_139", 139)
 
+  block execCmdTest:
+    let output = compileNimProg("-d:release -d:case_testfile", "D20220705T221100")
+    doAssert execCmd(output & " exit_0") == 0
+    doAssert execCmd(output & " exit_1") == 1
+    doAssert execCmd(output & " exit_2") == 2
+    doAssert execCmd(output & " exit_42") == 42
+
   import std/streams
 
   block execProcessTest: