about summary refs log tree commit homepage
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-17 22:42:56 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-17 22:42:56 -0700
commitcaddc46054b720bd88757b0c15de1d305216fa77 (patch)
tree16b614eeeb6d672c7e72648b3884e5eeeee62e22 /t/test-lib.sh
parentb32e9240ec68f2493038c5cfbc9ca6859cca6ad8 (diff)
downloadrainbows-caddc46054b720bd88757b0c15de1d305216fa77.tar.gz
At least these tests all run with dash now, but ksh93
or bash is still recommended for pipefail
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 29b57f7..5b9a90a 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1,7 +1,18 @@
 #!/bin/sh
 # Copyright (c) 2009 Rainbows! developers
 
-set -o pipefail >/dev/null 2>&1 || : # non-POSIX, but useful in ksh/bash
+# pipefail is non-POSIX, but useful in ksh/bash
+(
+        set +e
+        set -o pipefail
+)
+if test $? -eq 0
+then
+        set -o pipefail
+else
+        echo >&2 "WARNING: your shell does not understand pipefail"
+fi
+
 set -e
 set -u
 T=$(basename $0)