diff options
author | Jim Meyering <meyering@fb.com> | 2016-11-08 19:57:41 -0600 |
---|---|---|
committer | Jim Meyering <meyering@fb.com> | 2016-11-13 08:26:19 -0800 |
commit | 22063c8c083d2d8130efb76482e45fa1976a595a (patch) | |
tree | 18645c547557304f18702e3c07b83fb3793ea135 /tests/misc/timeout.sh | |
parent | 4d45722d1160a04e4d26fd812da4e0140ad3550c (diff) | |
download | coreutils-22063c8c083d2d8130efb76482e45fa1976a595a.tar.xz |
tests: use "returns_" rather than explicit comparison with "$?"
* tests/chmod/no-x.sh: Likewise.
* tests/cp/no-deref-link1.sh: Likewise.
* tests/cp/no-deref-link2.sh: Likewise.
* tests/cp/no-deref-link3.sh: Likewise.
* tests/du/move-dir-while-traversing.sh: Likewise.
* tests/ls/infloop.sh: Likewise.
* tests/ls/stat-failed.sh: Likewise.
* tests/ls/time-style-diag.sh: Likewise.
* tests/misc/chroot-fail.sh: Likewise.
* tests/misc/env-null.sh: Likewise.
* tests/misc/env.sh: Likewise.
* tests/misc/nice-fail.sh: Likewise.
* tests/misc/printenv.sh: Likewise.
* tests/misc/timeout.sh: Likewise.
* tests/tail-2/follow-name.sh: Likewise.
Diffstat (limited to 'tests/misc/timeout.sh')
-rwxr-xr-x | tests/misc/timeout.sh | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/misc/timeout.sh b/tests/misc/timeout.sh index dcee6d7ce..208c954c5 100755 --- a/tests/misc/timeout.sh +++ b/tests/misc/timeout.sh @@ -30,23 +30,19 @@ timeout 1d true || fail=1 timeout 0 true || fail=1 # exit status propagation -timeout 10 sh -c 'exit 2' -test $? = 2 || fail=1 +returns_ 2 timeout 10 sh -c 'exit 2' || fail=1 # timeout -timeout .1 sleep 10 -test $? = 124 || fail=1 +returns_ 124 timeout .1 sleep 10 || fail=1 # exit status propagation even on timeout -timeout --preserve-status .1 sleep 10 # exit status should be 128+TERM -test $? = 124 && fail=1 +returns_ 124 timeout --preserve-status .1 sleep 10 && fail=1 # kill delay. Note once the initial timeout triggers, # the exit status will be 124 even if the command # exits on its own accord. -timeout -s0 -k1 .1 sleep 10 -test $? = 124 && fail=1 +returns_ 124 timeout -s0 -k1 .1 sleep 10 && fail=1 # Ensure 'timeout' is immune to parent's SIGCHLD handler # Use a subshell and an exec to work around a bug in FreeBSD 5.0 /bin/sh. |