#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
# Test handling of input files with different charsets.
# 1. ISO-8859-1, 2. UTF-8; plus --use-first
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test3.in1 mcat-test3.in2"
cat <<\EOF > mcat-test3.in1
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
msgstr "Sie können sich als \"%1\" einloggen."
EOF
-tmpfiles="$tmpfiles mcat-test3.tmp mcat-test3.err mcat-test3.out"
rm -f mcat-test3.tmp
: ${MSGCAT=msgcat}
mcat-test3.in1 mcat-test3.in2 >mcat-test3.err 2>&1
result=$?
cat mcat-test3.err | grep -v 'warning: .* encodings' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test3.tmp > mcat-test3.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < mcat-test3.tmp > mcat-test3.out || exit 1
-tmpfiles="$tmpfiles mcat-test3.ok"
cat << \EOF > mcat-test3.ok
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
${DIFF} mcat-test3.ok mcat-test3.out
result=$?
-rm -fr $tmpfiles
-
exit $result