From 3f4031d1c0237636359e14304484fb569fcecc43 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 22 Mar 2012 17:35:42 +0000 Subject: Filter out $DESTDIR from morph output --- scripts/test-morph | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'scripts/test-morph') diff --git a/scripts/test-morph b/scripts/test-morph index f26d930e..1101d2b3 100755 --- a/scripts/test-morph +++ b/scripts/test-morph @@ -14,8 +14,26 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# Wrapper around morph for use by cmdtest tests. +# Wrapper around morph for use by cmdtest tests. This does several things: +# +# * simpler command lines for running morph, so that each test does not +# need to add --no-default-config and other options every time +# * replace temporary filenames ($DATADIR) in the output with a known +# string ("TMP"), so that test output is deterministic set -eu -"$SRCDIR/morph" --no-default-config --config="$DATADIR/morph.conf" "$@" +if "$SRCDIR/morph" --no-default-config --config="$DATADIR/morph.conf" "$@" \ + > "$DATADIR/stdout" 2> "$DATADIR/stderr" +then + exit=0 +else + exit=1 +fi + +sed -i "s,$DATADIR,TMP,g" "$DATADIR/stdout" "$DATADIR/stderr" +cat "$DATADIR/stdout" +cat "$DATADIR/stderr" 1>&2 + +exit "$exit" + -- cgit v1.2.1