Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-perl-5
index 2783070..5020baf 100755 (executable)
@@ -1,11 +1,8 @@
 #!/bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
 
 # Test Perl support: --add-comments option.
 
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-pl-5.pl"
 cat <<EOF > xg-pl-5.pl
 # This comment will not be extracted.
 print gettext "help";
@@ -18,15 +15,11 @@ print gettext "Hey Jude";
 print gettext "The Fabulous Four";
 EOF
 
-tmpfiles="$tmpfiles xg-pl-5.tmp.po xg-pl-5.po"
 : ${XGETTEXT=xgettext}
 ${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
-  -d xg-pl-5.tmp xg-pl-5.pl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-pl-5.tmp.po > xg-pl-5.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+  -d xg-pl-5.tmp xg-pl-5.pl || exit 1
+LC_ALL=C tr -d '\r' < xg-pl-5.tmp.po > xg-pl-5.po || exit 1
 
-tmpfiles="$tmpfiles xg-pl-5.ok"
 cat <<EOF > xg-pl-5.ok
 msgid "help"
 msgstr ""
@@ -48,6 +41,4 @@ EOF
 ${DIFF} xg-pl-5.ok xg-pl-5.po
 result=$?
 
-rm -fr $tmpfiles
-
 exit $result