Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msggrep-4
index 8e92d5f..b15b51a 100755 (executable)
@@ -1,11 +1,8 @@
 #! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
 
 # Test multiple -e and multiple -f options.
 
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mg-test4.po"
 cat <<\EOF > mg-test4.po
 # German translations for GNU gettext package.
 # Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
@@ -155,23 +152,18 @@ msgid "%s subprocess got fatal signal"
 msgstr "Subprozess %s hat ein fatales Signal erhalten"
 EOF
 
-tmpfiles="$tmpfiles mg-test4.in1"
 echo 'invalid' > mg-test4.in1
 
-tmpfiles="$tmpfiles mg-test4.in2"
 echo 'illegal' > mg-test4.in2
 
-tmpfiles="$tmpfiles mg-test4.tmp mg-test4.err mg-test4.out"
 : ${MSGGREP=msggrep}
 LC_MESSAGES=C LC_ALL= \
 ${MSGGREP} -K -e error -f mg-test4.in1 -f mg-test4.in2 -e cannot -o mg-test4.tmp mg-test4.po > mg-test4.err 2>&1
 result=$?
 cat mg-test4.err | grep -v 'warning: Locale charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mg-test4.tmp > mg-test4.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < mg-test4.tmp > mg-test4.out || exit 1
 
-tmpfiles="$tmpfiles mg-test4.ok"
 cat <<\EOF > mg-test4.ok
 # German translations for GNU gettext package.
 # Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
@@ -240,6 +232,4 @@ EOF
 ${DIFF} mg-test4.ok mg-test4.out
 result=$?
 
-rm -fr $tmpfiles
-
 exit $result