X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=tests%2Flib.sh;h=7face08e441416bdac527b843467f32723ff5977;hb=8793959e82e055ca063fb1d724eb12eec0afd701;hp=08309c7401af00ffd5572d7d3a386a92019e890b;hpb=b926752fac0fc420ae8e8d78c26f1815d35e89ed;p=coloredstderr%2Fcoloredstderr.git diff --git a/tests/lib.sh b/tests/lib.sh index 08309c7..7face08 100644 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -20,6 +20,7 @@ set -e # Allow running the script directly without running `make check`. test "x$builddir" = x && builddir=. +test "x$abs_builddir" = x && abs_builddir="`pwd`" test "x$EGREP" = x && EGREP='grep -E' # The tests fail if running under coloredstderr because the tests redirect @@ -99,6 +100,10 @@ run_test() { $valgrind_cmd "$@" "$testcase" > "$output" 2>&1 ) + # Some sed implementations (e.g. on FreeBSD 9.1) always append a trailing + # newline. Add "EOF" to detect if the real output had one. + echo EOF >> "$output" + # Merge continuous regions of colored output. The exact calls don't matter # as long as the output is colored. sed 's/STDERR>//g' < "$output" > "$output.tmp"