summaryrefslogtreecommitdiff
path: root/scripts/test-morph
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-22 17:35:42 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-22 17:35:42 +0000
commit3f4031d1c0237636359e14304484fb569fcecc43 (patch)
treefb4e48d1e9737a2fccacf278b99b4cdd7d14cf44 /scripts/test-morph
parent0057161d2a2d07b90d23409ed2267bc31f5ead1e (diff)
downloadmorph-3f4031d1c0237636359e14304484fb569fcecc43.tar.gz
Filter out $DESTDIR from morph output
Diffstat (limited to 'scripts/test-morph')
-rwxr-xr-xscripts/test-morph22
1 files changed, 20 insertions, 2 deletions
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"
+