# Library for the test suite.
-# Copyright (C) 2013 Simon Ruderich
+# Copyright (C) 2013-2014 Simon Ruderich
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# 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
$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<>STDERR>//g' < "$output" > "$output.tmp"