Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-c-4
index e5520dd..7db3e35 100755 (executable)
@@ -1,23 +1,16 @@
 #! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
 
 # Test C support: --trigraphs option.
 
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-4.in.c"
 cat <<EOF > xg-c-4.in.c
-main()??<printf(gettext("Hello, " "World!" "??/n")); ??>
+main()??<printf(gettext("Hello, " "World!" "??/n"));return 0 ? a??(0??'1??) : 1??!??-a[0]??#1;????>
 EOF
 
-tmpfiles="$tmpfiles xg-c-4.tmp.po xg-c-4.po"
 : ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location --trigraphs -d xg-c-4.tmp xg-c-4.in.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-4.tmp.po > xg-c-4.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location --trigraphs -d xg-c-4.tmp xg-c-4.in.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-4.tmp.po > xg-c-4.po || exit 1
 
-tmpfiles="$tmpfiles xg-c-4.ok"
 cat <<EOF > xg-c-4.ok
 #, c-format
 msgid "Hello, World!\n"
@@ -28,6 +21,4 @@ EOF
 ${DIFF} xg-c-4.ok xg-c-4.po
 result=$?
 
-rm -fr $tmpfiles
-
 exit $result