export COLORED_STDERR_FDS
# Change pre/post strings for simpler testing.
- COLORED_STDERR_PRE='>stderr>'
- COLORED_STDERR_POST='<stderr<'
+ COLORED_STDERR_PRE='>STDERR>'
+ COLORED_STDERR_POST='<STDERR<'
export COLORED_STDERR_PRE
export COLORED_STDERR_POST
# And force writes to a file (unless we are testing the force).
export COLORED_STDERR_FORCE_WRITE
fi
- "$testcase" > output 2>&1
+ $valgrind_cmd "$@" "$testcase" > output 2>&1
)
diff -u "$expected" output \
}
test_script() {
- run_test "$srcdir/$1" "$srcdir/$1.expected"
+ testcase="$1"
+ shift
+ run_test "$srcdir/$testcase" "$srcdir/$testcase.expected" "$@"
+}
+test_script_subshell() {
+ test_script "$1" bash -c 'bash $1' ''
}
test_program() {
- run_test "$builddir/$1" "$srcdir/$1.expected"
+ testcase="$1"
+ shift
+ run_test "$builddir/$testcase" "$srcdir/$testcase.expected" "$@"
+}
+test_program_subshell() {
+ test_program "$1" sh -c '$1' ''
}