about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-10 12:28:51 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-10 12:28:51 -0700
commit79b28210e3af5422002ef4ad79e77620295a4d38 (patch)
tree39a351a53fce578b7dc069e250f0decd5baf13e3
parent1925c176d2b822c6c17aec472e318669f054beda (diff)
downloadrainbows-79b28210e3af5422002ef4ad79e77620295a4d38.tar.gz
pipefail is extremely useful for detecting bad exits _anywhere_
in pipelines, not just the last command.  Combined with
"set -e", pipefail leads to very unforgiving scripts that
bail out at the first sign of error, exactly what we want
in tests.
-rw-r--r--t/test-lib.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index e5b0bc8..d278329 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 # Copyright (c) 2009 Rainbows! developers
+
+set -o pipefail >/dev/null 2>&1 || : # non-POSIX, but useful in ksh/bash
 set -e
 set -u
 T=$(basename $0)