diff options
author | Steve Bennett <steveb@workware.net.au> | 2022-05-08 15:16:46 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2022-05-08 15:45:27 +1000 |
commit | 8bcdb359a0c7217dfebc73c61037a005bb65717d (patch) | |
tree | 30511cd2fa9d9155a2225a6b90b863aec469f92c | |
parent | 3920cedd1cdd4702720773f0637b780f79be6158 (diff) | |
download | jimtcl-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>
-rw-r--r-- | tests/exec.test | 4 | ||||
-rw-r--r-- | tests/exec2.test | 7 |
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 |