Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgmerge-12
index 158a118..46c25a6 100755 (executable)
@@ -1,12 +1,9 @@
 #! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
 
 # Test merging of a message which has plural forms in def.po but not
 # in ref.pot.
 
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test12.po"
 cat <<EOF > mm-test12.po
 # SOME DESCRIPTIVE TITLE.
 # Copyright (C) YEAR Free Software Foundation, Inc.
@@ -31,7 +28,6 @@ msgstr[0] "%d erreur"
 msgstr[1] "%d erreurs"
 EOF
 
-tmpfiles="$tmpfiles mm-test12.pot"
 cat <<EOF > mm-test12.pot
 # SOME DESCRIPTIVE TITLE.
 # Copyright (C) YEAR Free Software Foundation, Inc.
@@ -54,14 +50,10 @@ msgid "%d error"
 msgstr ""
 EOF
 
-tmpfiles="$tmpfiles mm-test12.tmp mm-test12.out"
 : ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test12.tmp mm-test12.po mm-test12.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test12.tmp > mm-test12.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test12.tmp mm-test12.po mm-test12.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test12.tmp > mm-test12.out || exit 1
 
-tmpfiles="$tmpfiles mm-test12.ok"
 cat <<EOF > mm-test12.ok
 # SOME DESCRIPTIVE TITLE.
 # Copyright (C) YEAR Free Software Foundation, Inc.
@@ -89,6 +81,4 @@ EOF
 ${DIFF} mm-test12.ok mm-test12.out
 result=$?
 
-rm -fr $tmpfiles
-
 exit $result