summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/lang-python-2
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2014-03-10 18:13:28 +0900
committerDaiki Ueno <ueno@gnu.org>2014-03-10 18:24:15 +0900
commitd66197a3ca8355efa22f1d9c687f41eb30ae19ff (patch)
treec4acc964d617b04629a3a3bbb7632f34cdb35b9c /gettext-tools/tests/lang-python-2
parent0e79f41006d2b4d69dd3eb57c0202faa6c1fba44 (diff)
downloadexternal_gettext-d66197a3ca8355efa22f1d9c687f41eb30ae19ff.zip
external_gettext-d66197a3ca8355efa22f1d9c687f41eb30ae19ff.tar.gz
external_gettext-d66197a3ca8355efa22f1d9c687f41eb30ae19ff.tar.bz2
tests: Remove unnecessary tempfile cleanup code
Cleanup code like "rm -fr $tmpfiles" are no longer needed, since 'init.sh' takes care of that.
Diffstat (limited to 'gettext-tools/tests/lang-python-2')
-rw-r--r--[-rwxr-xr-x]gettext-tools/tests/lang-python-232
1 files changed, 8 insertions, 24 deletions
diff --git a/gettext-tools/tests/lang-python-2 b/gettext-tools/tests/lang-python-2
index 770babe..eb58c1a 100755..100644
--- a/gettext-tools/tests/lang-python-2
+++ b/gettext-tools/tests/lang-python-2
@@ -8,10 +8,6 @@
# It looks like a bug in Python's gettext.py. This here is a quick workaround:
UTF8_LOCALE_UNSUPPORTED=yes
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles prog2.py"
cat <<\EOF > prog2.py
import sys
import gettext
@@ -28,14 +24,10 @@ print gettext.gettext("%(oldCurrency)s is replaced by %(newCurrency)s.") \
% { 'oldCurrency': "FF", 'newCurrency' : "EUR" }
EOF
-tmpfiles="$tmpfiles l-python-2-prog.tmp l-python-2-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-python-2-prog.tmp --omit-header --no-location prog2.py
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-python-2-prog.tmp > l-python-2-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-python-2-prog.tmp --omit-header --no-location prog2.py || exit 1
+LC_ALL=C tr -d '\r' < l-python-2-prog.tmp > l-python-2-prog.pot || exit 1
-tmpfiles="$tmpfiles l-python-2-prog.ok"
cat <<EOF > l-python-2-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
@@ -54,7 +46,6 @@ EOF
: ${DIFF=diff}
${DIFF} l-python-2-prog.ok l-python-2-prog.pot || exit 1
-tmpfiles="$tmpfiles l-python-2-fr.po"
cat <<\EOF > l-python-2-fr.po
msgid ""
msgstr ""
@@ -77,17 +68,13 @@ msgid "%(oldCurrency)s is replaced by %(newCurrency)s."
msgstr "%(newCurrency)s remplace %(oldCurrency)s."
EOF
-tmpfiles="$tmpfiles l-python-2-fr.po.tmp l-python-2-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-python-2-fr.po.tmp l-python-2-fr.po l-python-2-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-python-2-fr.po.tmp > l-python-2-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-python-2-fr.po.tmp l-python-2-fr.po l-python-2-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-python-2-fr.po.tmp > l-python-2-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-python-2-fr.po l-python-2-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-python-2"
test -d l-python-2 || mkdir l-python-2
test -d l-python-2/fr || mkdir l-python-2/fr
test -d l-python-2/fr/LC_MESSAGES || mkdir l-python-2/fr/LC_MESSAGES
@@ -97,13 +84,12 @@ ${MSGFMT} -o l-python-2/fr/LC_MESSAGES/prog.mo l-python-2-fr.po
# Test for presence of python version 2.3 or newer.
(python -V) >/dev/null 2>/dev/null \
- || { echo "Skipping test: python not found"; rm -fr $tmpfiles; exit 77; }
+ || { echo "Skipping test: python not found"; exit 77; }
case `python -c 'import sys; print sys.hexversion >= 0x20300F0'` in
1 | True) ;;
- *) echo "Skipping test: python version too old"; rm -fr $tmpfiles; exit 77;;
+ *) echo "Skipping test: python version too old"; exit 77;;
esac
-tmpfiles="$tmpfiles l-python-2-prog.ok l-python-2-prog.oku l-python-2-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-python-2-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
@@ -133,7 +119,7 @@ if test -z "$UTF8_LOCALE_UNSUPPORTED"; then
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
else
if test $LOCALE_FR = none; then
@@ -142,10 +128,8 @@ else
else
echo "Skipping test: no traditional french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
fi
-rm -fr $tmpfiles
-
exit 0