From caddc46054b720bd88757b0c15de1d305216fa77 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 17 Oct 2009 22:42:56 -0700 Subject: tests: fix issues with non-portable shell constructs At least these tests all run with dash now, but ksh93 or bash is still recommended for pipefail --- t/test-lib.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 't/test-lib.sh') 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) -- cgit v1.2.3-24-ge0c7