X-Git-Url: https://ruderich.org/simon/gitweb/?p=coloredstderr%2Fcoloredstderr.git;a=blobdiff_plain;f=tests%2Flib.sh;h=08309c7401af00ffd5572d7d3a386a92019e890b;hp=2f2c736711fc787fb74ca066aac4d3afb68b4cc6;hb=b926752fac0fc420ae8e8d78c26f1815d35e89ed;hpb=2c55827f6f2c231a8f166e015df4c5c3818c8ba4 diff --git a/tests/lib.sh b/tests/lib.sh index 2f2c736..08309c7 100644 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -99,6 +99,11 @@ run_test() { $valgrind_cmd "$@" "$testcase" > "$output" 2>&1 ) + # 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" + mv "$output.tmp" "$output" + diff -u "$expected" "$output" \ || die 'failed!' rm "$output" @@ -118,7 +123,7 @@ test_script() { run_test "$srcdir/$testcase" "$srcdir/$expected.expected" "$@" } test_script_subshell() { - test_script "$1" "$2" bash -c 'bash $1' '' + test_script "$1" "$2" sh -c 'sh $1' '' } test_program() { testcase="$1"