diff options
author | Daiki Ueno <ueno@gnu.org> | 2014-03-10 18:13:28 +0900 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2014-03-10 18:24:15 +0900 |
commit | d66197a3ca8355efa22f1d9c687f41eb30ae19ff (patch) | |
tree | c4acc964d617b04629a3a3bbb7632f34cdb35b9c /gettext-tools/tests/lang-lua | |
parent | 0e79f41006d2b4d69dd3eb57c0202faa6c1fba44 (diff) | |
download | external_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-lua')
-rw-r--r--[-rwxr-xr-x] | gettext-tools/tests/lang-lua | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/gettext-tools/tests/lang-lua b/gettext-tools/tests/lang-lua index 3fbe068..d6f8e71 100755..100644 --- a/gettext-tools/tests/lang-lua +++ b/gettext-tools/tests/lang-lua @@ -5,10 +5,6 @@ # Assumes an fr_FR locale is installed. # Assumes the following packages are installed: lua, lua-gettext. -tmpfiles="" -trap 'rm -fr $tmpfiles' 1 2 3 15 - -tmpfiles="$tmpfiles prog.lua" cat <<\EOF > prog.lua require("gettext") gettext.bindtextdomain("prog", "l-lua") @@ -21,14 +17,10 @@ print(string.format(gettext.ngettext('a piece of cake', [[%d pieces of cake]], n print(string.format(_[==[%s is replaced by %s.]==], "FF", "EUR")) EOF -tmpfiles="$tmpfiles l-lua-prog.tmp l-lua-prog.pot" : ${XGETTEXT=xgettext} -${XGETTEXT} -o l-lua-prog.tmp --omit-header --no-location prog.lua -test $? = 0 || { rm -fr $tmpfiles; exit 1; } -LC_ALL=C tr -d '\r' < l-lua-prog.tmp > l-lua-prog.pot -test $? = 0 || { rm -fr $tmpfiles; exit 1; } +${XGETTEXT} -o l-lua-prog.tmp --omit-header --no-location prog.lua || exit 1 +LC_ALL=C tr -d '\r' < l-lua-prog.tmp > l-lua-prog.pot || exit 1 -tmpfiles="$tmpfiles l-lua-prog.ok" cat <<\EOF > l-lua-prog.ok msgid "'Your command, please?', asked the waiter." msgstr "" @@ -47,7 +39,6 @@ EOF : ${DIFF=diff} ${DIFF} l-lua-prog.ok l-lua-prog.pot || exit 1 -tmpfiles="$tmpfiles l-lua-fr.po" cat <<\EOF > l-lua-fr.po msgid "" msgstr "" @@ -68,17 +59,13 @@ msgid "%s is replaced by %s." msgstr "%s remplace %s." EOF -tmpfiles="$tmpfiles l-lua-fr.po.tmp l-lua-fr.po.new" : ${MSGMERGE=msgmerge} -${MSGMERGE} -q -o l-lua-fr.po.tmp l-lua-fr.po l-lua-prog.pot -test $? = 0 || { rm -fr $tmpfiles; exit 1; } -LC_ALL=C tr -d '\r' < l-lua-fr.po.tmp > l-lua-fr.po.new -test $? = 0 || { rm -fr $tmpfiles; exit 1; } +${MSGMERGE} -q -o l-lua-fr.po.tmp l-lua-fr.po l-lua-prog.pot || exit 1 +LC_ALL=C tr -d '\r' < l-lua-fr.po.tmp > l-lua-fr.po.new || exit 1 : ${DIFF=diff} ${DIFF} l-lua-fr.po l-lua-fr.po.new || exit 1 -tmpfiles="$tmpfiles l-lua" test -d l-lua || mkdir l-lua test -d l-lua/fr || mkdir l-lua/fr test -d l-lua/fr/LC_MESSAGES || mkdir l-lua/fr/LC_MESSAGES @@ -89,14 +76,14 @@ ${MSGFMT} -o l-lua/fr/LC_MESSAGES/prog.mo l-lua-fr.po # Test for presence of lua version 5.0 or newer with gettext support. (lua -v) >/dev/null 2>/dev/null test $? -le 1 \ - || { echo "Skipping test: lua not found"; rm -fr $tmpfiles; exit 77; } + || { echo "Skipping test: lua not found"; exit 77; } case `lua -v 2>&1 | sed -e 's/^[^0-9]*//'` in [5-9].*) ;; - *) echo "Skipping test: lua version too old"; rm -fr $tmpfiles; exit 77;; + *) echo "Skipping test: lua version too old"; exit 77;; esac { lua -v -l gettext > /dev/null 2>/dev/null; } \ || { echo "Skipping test: lua gettext module not found" - rm -fr $tmpfiles; exit 77 + exit 77 } # Test which of the fr_FR locales are installed. @@ -124,10 +111,9 @@ if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then else echo "Skipping test: no french locale is supported" fi - rm -fr $tmpfiles; exit 77 + exit 77 fi -tmpfiles="$tmpfiles l-lua-prog.ok l-lua-prog.oku l-lua-prog.out" : ${DIFF=diff} cat <<\EOF > l-lua-prog.ok «Votre commande, s'il vous plait», dit le garçon. @@ -151,6 +137,4 @@ if test $LOCALE_FR_UTF8 != none; then ${DIFF} l-lua-prog.oku l-lua-prog.out || exit 1 fi -rm -fr $tmpfiles - exit 0 |