Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-awk-2
index 5ff65dc..14908fe 100755 (executable)
@@ -1,11 +1,8 @@
 #!/bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
 
 # Test awk support: --add-comments option.
 
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-a-2.awk"
 cat <<\EOF > xg-a-2.awk
 # a
 string = # b
@@ -15,15 +12,11 @@ _"hello world" # d
 ;
 EOF
 
-tmpfiles="$tmpfiles xg-a-2.tmp.po xg-a-2.po"
 : ${XGETTEXT=xgettext}
 ${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
-  -d xg-a-2.tmp xg-a-2.awk
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-a-2.tmp.po > xg-a-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+  -d xg-a-2.tmp xg-a-2.awk || exit 1
+LC_ALL=C tr -d '\r' < xg-a-2.tmp.po > xg-a-2.po || exit 1
 
-tmpfiles="$tmpfiles xg-a-2.ok"
 cat <<EOF > xg-a-2.ok
 #. a
 #. b
@@ -36,6 +29,4 @@ EOF
 ${DIFF} xg-a-2.ok xg-a-2.po
 result=$?
 
-rm -fr $tmpfiles
-
 exit $result