Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-sh-1
index b40b509..28e2051 100755 (executable)
@@ -1,11 +1,8 @@
 #!/bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
 
 # Test of Shell support.
 
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-sh-1.sh"
 cat <<\EOF > xg-sh-1.sh
 # Test backslash before normal alphabetic character.
 
@@ -464,16 +461,12 @@ echo "`echo "\`ngettext 'depth_2_11_squote_7_semi \\\\\\\;'\`"`"
 echo "`echo "\`ngettext 'depth_2_11_squote_8_semi \\\\\\\\;'\`"`"
 EOF
 
-tmpfiles="$tmpfiles xg-sh-1.tmp.po xg-sh-1.po"
 : ${XGETTEXT=xgettext}
 # Here we use ngettext with two signatures: ngettext:1 and ngettext:1,2.
 ${XGETTEXT} --omit-header --no-location --keyword=ngettext:1 \
-  -d xg-sh-1.tmp xg-sh-1.sh
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-sh-1.tmp.po > xg-sh-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+  -d xg-sh-1.tmp xg-sh-1.sh || exit 1
+LC_ALL=C tr -d '\r' < xg-sh-1.tmp.po > xg-sh-1.po || exit 1
 
-tmpfiles="$tmpfiles xg-sh-1.ok"
 cat <<\EOF > xg-sh-1.ok
 msgid "depth_0_none_0_x"
 msgstr ""
@@ -1810,6 +1803,4 @@ EOF
 ${DIFF} xg-sh-1.ok xg-sh-1.po
 result=$?
 
-rm -fr $tmpfiles
-
 exit $result