Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-c-1
index 58bb193..039e7ec 100755 (executable)
@@ -1,24 +1,17 @@
 #! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
 
 # This test often fails during development. It works after "make dist".
 
 # Test C support.
 
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-1.tmp.po xg-c-1.po"
 : ${XGETTEXT=xgettext}
 ${XGETTEXT} -d xg-c-1.tmp -k_ --omit-header --no-location \
- $top_srcdir/src/xgettext.c $top_srcdir/src/msgfmt.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-1.tmp.po > xg-c-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ "$abs_top_srcdir"/src/xgettext.c "$abs_top_srcdir"/src/msgfmt.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-1.tmp.po > xg-c-1.po || exit 1
 
 : ${DIFF=diff}
-${DIFF} $top_srcdir/tests/xg-c-1.ok.po xg-c-1.po
+${DIFF} "$abs_srcdir"/xg-c-1.ok.po xg-c-1.po
 result=$?
 
-rm -fr $tmpfiles
-
 exit $result