Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-objc-1
index d2200ed..9563d77 100755 (executable)
@@ -1,11 +1,8 @@
 #! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
 
 # Test ObjectiveC extractor.
 
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-ob-1.m"
 cat <<\EOF > xg-ob-1.m
 id str = _(@
 "conca" /* comment */
@@ -28,14 +25,10 @@ _ // test
 NSLocalizedString(@"Information", @"")
 EOF
 
-tmpfiles="$tmpfiles xg-ob-1.tmp.po xg-ob-1.po"
 : ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header -k_ -kNSLocalizedString -d xg-ob-1.tmp xg-ob-1.m
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-ob-1.tmp.po > xg-ob-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header -k_ -kNSLocalizedString -d xg-ob-1.tmp xg-ob-1.m || exit 1
+LC_ALL=C tr -d '\r' < xg-ob-1.tmp.po > xg-ob-1.po || exit 1
 
-tmpfiles="$tmpfiles xg-ob-1.ok"
 cat <<\EOF > xg-ob-1.ok
 #: xg-ob-1.m:2
 msgid "concatenated"
@@ -62,6 +55,4 @@ EOF
 ${DIFF} xg-ob-1.ok xg-ob-1.po
 result=$?
 
-rm -fr $tmpfiles
-
 exit $result