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,
(
# 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>'
export COLORED_STDERR_PRE
export COLORED_STDERR_POST
# And force writes to a file (unless we are testing the force).
- if test "x$force_write" != x; then
+ if test -n "$force_write"; then
COLORED_STDERR_FORCE_WRITE=1
export COLORED_STDERR_FORCE_WRITE
fi
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"
test_program() {
testcase="$1"
expected="$2"
- shift; shift || true
+ test $# -ge 2 && shift
+ shift
if test -z "$expected"; then
expected="$testcase"