Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-perl-8
index 74247cd..f45aff8 100755 (executable)
@@ -1,14 +1,11 @@
 #! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
 
 # The slash (/) and the question mark (?) serve a double-purpose in Perl.
 # Depending on the context they can either be an operator (division
 # or ternary respectively) or they are regex delimiters for pattern
 # matches.  This test case checks the proper recognition.
 
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-pl-8.pl"
 cat <<\EOF > xg-pl-8.pl
 info(__("using %s."), ($a->b() eq "auto" ? "" : ""));
 
@@ -63,16 +60,12 @@ print __"Chained method calls without parentheses do not accept arguments!";
 print __"Synching works.";
 EOF
 
-tmpfiles="$tmpfiles xg-pl-8.tmp.po xg-pl-8.po"
 : ${XGETTEXT=xgettext}
 ${XGETTEXT} --omit-header -n \
   -k__ \
-  -d xg-pl-8.tmp xg-pl-8.pl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-pl-8.tmp.po > xg-pl-8.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+  -d xg-pl-8.tmp xg-pl-8.pl || exit 1
+LC_ALL=C tr -d '\r' < xg-pl-8.tmp.po > xg-pl-8.po || exit 1
 
-tmpfiles="$tmpfiles xg-pl-8.ok"
 cat <<\EOF > xg-pl-8.ok
 #: xg-pl-8.pl:1
 #, perl-format
@@ -128,6 +121,4 @@ EOF
 ${DIFF} xg-pl-8.ok xg-pl-8.po
 result=$?
 
-rm -fr $tmpfiles
-
 exit $result