aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2022-05-08 15:16:46 +1000
committerSteve Bennett <steveb@workware.net.au>2022-05-08 15:45:27 +1000
commit8bcdb359a0c7217dfebc73c61037a005bb65717d (patch)
tree30511cd2fa9d9155a2225a6b90b863aec469f92c /tests
parent3920cedd1cdd4702720773f0637b780f79be6158 (diff)
downloadjimtcl-8bcdb359a0c7217dfebc73c61037a005bb65717d.zip
jimtcl-8bcdb359a0c7217dfebc73c61037a005bb65717d.tar.gz
jimtcl-8bcdb359a0c7217dfebc73c61037a005bb65717d.tar.bz2
tests: add tests for wait -1
Only on unix systems, wait for any child process This was broken with a recent commit, so add an explicit test Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests')
-rw-r--r--tests/exec.test4
-rw-r--r--tests/exec2.test7
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/exec.test b/tests/exec.test
index 11a4661..d20cc83 100644
--- a/tests/exec.test
+++ b/tests/exec.test
@@ -445,4 +445,8 @@ test exec-17.2 {redirecting to command pipeline} -setup {
file delete sleepx
+# Now we probably have a lot of unreaped zombies at this point
+# so reap them to avoid confusing further tests
+wait
+
testreport
diff --git a/tests/exec2.test b/tests/exec2.test
index b1af8ab..b1d0263 100644
--- a/tests/exec2.test
+++ b/tests/exec2.test
@@ -171,4 +171,11 @@ test exec2-5.5 {wait for all children} -constraints {after jim} -body {
wait
} -result {}
+test exec2-5.6 {wait -1 to wait for any child} -constraints {after jim nomingw32} -body {
+ set pid [exec sleep 0.1 &]
+ # Now wait for any child
+ lassign [wait -1] status waitpid code
+ list $status $($waitpid == $pid) $code
+} -result {CHILDSTATUS 1 0}
+
testreport