X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=tests%2Flib.sh;h=2f2c736711fc787fb74ca066aac4d3afb68b4cc6;hb=2c55827f6f2c231a8f166e015df4c5c3818c8ba4;hp=897d50e754ca38a4fe5bc6658b0a1217e8217818;hpb=3c2b4bf9f65fcf6f631d7529a3391c3564b3dc29;p=coloredstderr%2Fcoloredstderr.git diff --git a/tests/lib.sh b/tests/lib.sh index 897d50e..2f2c736 100644 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -40,7 +40,10 @@ fi LC_ALL=C unset LANGUAGE -# Set default COLORED_STDERR_FDS value. +# Clear user defined variables. +unset COLORED_STDERR_FDS +unset COLORED_STDERR_FORCE_WRITE +# Set default COLORED_STDERR_PRIVATE_FDS value. fds=2, @@ -78,9 +81,9 @@ run_test() { ( # Standard setup. LD_PRELOAD="$library" - COLORED_STDERR_FDS="$fds" + COLORED_STDERR_PRIVATE_FDS="$fds" export LD_PRELOAD - export COLORED_STDERR_FDS + export COLORED_STDERR_PRIVATE_FDS # Change pre/post strings for simpler testing. COLORED_STDERR_PRE='>STDERR>' @@ -105,7 +108,9 @@ run_test() { test_script() { testcase="$1" expected="$2" - shift; shift || true + # shift || true is not enough for dash. + test $# -ge 2 && shift + shift if test -z "$expected"; then expected="$testcase" @@ -118,7 +123,8 @@ test_script_subshell() { test_program() { testcase="$1" expected="$2" - shift; shift || true + test $# -ge 2 && shift + shift if test -z "$expected"; then expected="$testcase"