Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-c-15
index 5cf9252..5d86818 100755 (executable)
@@ -1,11 +1,8 @@
 #! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
 
 # Test C support: extraction of contexts specified in GNOME glib syntax.
 
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-15.c"
 cat <<\EOF > xg-c-15.c
 /* (glib) The 1-argument Q_ macro is a gettext with context. */
 print (Q_ ("Printer|Open"));
@@ -13,16 +10,12 @@ print (Q_ ("Printer|Open"));
 print (Q_ ("Menu|Recent File", "Menu|Recent Files"));
 EOF
 
-tmpfiles="$tmpfiles xg-c-15.tmp.po xg-c-15.po"
 : ${XGETTEXT=xgettext}
 ${XGETTEXT} --omit-header --no-location \
   --keyword=Q_:1g --keyword=Q_:1g,2g \
-  -d xg-c-15.tmp xg-c-15.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-15.tmp.po > xg-c-15.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+  -d xg-c-15.tmp xg-c-15.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-15.tmp.po > xg-c-15.po || exit 1
 
-tmpfiles="$tmpfiles xg-c-15.ok"
 cat <<EOF > xg-c-15.ok
 msgctxt "Printer"
 msgid "Open"
@@ -39,6 +32,4 @@ EOF
 ${DIFF} xg-c-15.ok xg-c-15.po
 result=$?
 
-rm -fr $tmpfiles
-
 exit $result