+2014-03-10 Daiki Ueno <ueno@gnu.org>
+
+ Remove unnecessary temporary file cleanup code.
+ Cleanup code like "rm -fr $tmpfiles" are no longer needed, since
+ 'init.sh' takes care of that.
+ * format-awk-1: Remove unnecessary temporary file cleanup code.
+ * format-awk-2: Likewise
+ * format-boost-1: Likewise
+ * format-boost-2: Likewise
+ * format-c-1: Likewise
+ * format-c-2: Likewise
+ * format-c-3: Likewise
+ * format-c-4: Likewise
+ * format-c-5: Likewise
+ * format-csharp-1: Likewise
+ * format-csharp-2: Likewise
+ * format-elisp-1: Likewise
+ * format-elisp-2: Likewise
+ * format-gcc-internal-1: Likewise
+ * format-gcc-internal-2: Likewise
+ * format-gfc-internal-1: Likewise
+ * format-gfc-internal-2: Likewise
+ * format-java-1: Likewise
+ * format-java-2: Likewise
+ * format-javascript-1: Likewise
+ * format-javascript-2: Likewise
+ * format-kde-1: Likewise
+ * format-kde-2: Likewise
+ * format-librep-1: Likewise
+ * format-librep-2: Likewise
+ * format-lisp-1: Likewise
+ * format-lisp-2: Likewise
+ * format-lua-1: Likewise
+ * format-lua-2: Likewise
+ * format-pascal-1: Likewise
+ * format-pascal-2: Likewise
+ * format-perl-1: Likewise
+ * format-perl-2: Likewise
+ * format-perl-brace-1: Likewise
+ * format-perl-brace-2: Likewise
+ * format-perl-mixed-1: Likewise
+ * format-perl-mixed-2: Likewise
+ * format-php-1: Likewise
+ * format-php-2: Likewise
+ * format-python-1: Likewise
+ * format-python-2: Likewise
+ * format-python-brace-1: Likewise
+ * format-python-brace-2: Likewise
+ * format-qt-1: Likewise
+ * format-qt-2: Likewise
+ * format-qt-plural-1: Likewise
+ * format-qt-plural-2: Likewise
+ * format-scheme-1: Likewise
+ * format-scheme-2: Likewise
+ * format-sh-1: Likewise
+ * format-sh-2: Likewise
+ * format-tcl-1: Likewise
+ * format-tcl-2: Likewise
+ * format-ycp-1: Likewise
+ * format-ycp-2: Likewise
+ * gettext-1: Likewise
+ * gettext-2: Likewise
+ * gettext-3: Likewise
+ * gettext-4: Likewise
+ * gettext-5: Likewise
+ * gettext-6: Likewise
+ * gettext-7: Likewise
+ * gettextpo-1: Likewise
+ * lang-bash: Likewise
+ * lang-c: Likewise
+ * lang-c++: Likewise
+ * lang-clisp: Likewise
+ * lang-csharp: Likewise
+ * lang-elisp: Likewise
+ * lang-gawk: Likewise
+ * lang-guile: Likewise
+ * lang-java: Likewise
+ * lang-javascript: Likewise
+ * lang-librep: Likewise
+ * lang-lua: Likewise
+ * lang-objc: Likewise
+ * lang-pascal: Likewise
+ * lang-perl-1: Likewise
+ * lang-perl-2: Likewise
+ * lang-php: Likewise
+ * lang-po: Likewise
+ * lang-python-1: Likewise
+ * lang-python-2: Likewise
+ * lang-rst: Likewise
+ * lang-sh: Likewise
+ * lang-smalltalk: Likewise
+ * lang-tcl: Likewise
+ * lang-vala: Likewise
+ * lang-ycp: Likewise
+ * msgattrib-1: Likewise
+ * msgattrib-10: Likewise
+ * msgattrib-11: Likewise
+ * msgattrib-12: Likewise
+ * msgattrib-13: Likewise
+ * msgattrib-14: Likewise
+ * msgattrib-15: Likewise
+ * msgattrib-16: Likewise
+ * msgattrib-17: Likewise
+ * msgattrib-2: Likewise
+ * msgattrib-3: Likewise
+ * msgattrib-4: Likewise
+ * msgattrib-5: Likewise
+ * msgattrib-6: Likewise
+ * msgattrib-7: Likewise
+ * msgattrib-8: Likewise
+ * msgattrib-9: Likewise
+ * msgattrib-properties-1: Likewise
+ * msgcat-1: Likewise
+ * msgcat-10: Likewise
+ * msgcat-11: Likewise
+ * msgcat-12: Likewise
+ * msgcat-13: Likewise
+ * msgcat-14: Likewise
+ * msgcat-15: Likewise
+ * msgcat-16: Likewise
+ * msgcat-17: Likewise
+ * msgcat-18: Likewise
+ * msgcat-2: Likewise
+ * msgcat-3: Likewise
+ * msgcat-4: Likewise
+ * msgcat-5: Likewise
+ * msgcat-6: Likewise
+ * msgcat-7: Likewise
+ * msgcat-8: Likewise
+ * msgcat-9: Likewise
+ * msgcat-properties-1: Likewise
+ * msgcat-properties-2: Likewise
+ * msgcat-stringtable-1: Likewise
+ * msgcmp-1: Likewise
+ * msgcmp-2: Likewise
+ * msgcmp-3: Likewise
+ * msgcmp-4: Likewise
+ * msgcomm-1: Likewise
+ * msgcomm-10: Likewise
+ * msgcomm-11: Likewise
+ * msgcomm-12: Likewise
+ * msgcomm-13: Likewise
+ * msgcomm-14: Likewise
+ * msgcomm-15: Likewise
+ * msgcomm-16: Likewise
+ * msgcomm-17: Likewise
+ * msgcomm-18: Likewise
+ * msgcomm-19: Likewise
+ * msgcomm-2: Likewise
+ * msgcomm-20: Likewise
+ * msgcomm-21: Likewise
+ * msgcomm-22: Likewise
+ * msgcomm-23: Likewise
+ * msgcomm-24: Likewise
+ * msgcomm-25: Likewise
+ * msgcomm-26: Likewise
+ * msgcomm-27: Likewise
+ * msgcomm-3: Likewise
+ * msgcomm-4: Likewise
+ * msgcomm-5: Likewise
+ * msgcomm-6: Likewise
+ * msgcomm-7: Likewise
+ * msgcomm-8: Likewise
+ * msgcomm-9: Likewise
+ * msgconv-1: Likewise
+ * msgconv-2: Likewise
+ * msgconv-3: Likewise
+ * msgconv-4: Likewise
+ * msgconv-5: Likewise
+ * msgconv-6: Likewise
+ * msgen-1: Likewise
+ * msgen-2: Likewise
+ * msgen-3: Likewise
+ * msgexec-1: Likewise
+ * msgexec-2: Likewise
+ * msgexec-3: Likewise
+ * msgexec-4: Likewise
+ * msgfilter-1: Likewise
+ * msgfilter-2: Likewise
+ * msgfilter-3: Likewise
+ * msgfilter-4: Likewise
+ * msgfilter-sr-latin-1: Likewise
+ * msgfmt-1: Likewise
+ * msgfmt-10: Likewise
+ * msgfmt-11: Likewise
+ * msgfmt-12: Likewise
+ * msgfmt-13: Likewise
+ * msgfmt-14: Likewise
+ * msgfmt-15: Likewise
+ * msgfmt-16: Likewise
+ * msgfmt-17: Likewise
+ * msgfmt-2: Likewise
+ * msgfmt-3: Likewise
+ * msgfmt-4: Likewise
+ * msgfmt-5: Likewise
+ * msgfmt-6: Likewise
+ * msgfmt-7: Likewise
+ * msgfmt-8: Likewise
+ * msgfmt-9: Likewise
+ * msgfmt-properties-1: Likewise
+ * msgfmt-qt-1: Likewise
+ * msgfmt-qt-2: Likewise
+ * msggrep-1: Likewise
+ * msggrep-10: Likewise
+ * msggrep-2: Likewise
+ * msggrep-3: Likewise
+ * msggrep-4: Likewise
+ * msggrep-5: Likewise
+ * msggrep-6: Likewise
+ * msggrep-7: Likewise
+ * msggrep-8: Likewise
+ * msggrep-9: Likewise
+ * msginit-1: Likewise
+ * msginit-2: Likewise
+ * msgmerge-1: Likewise
+ * msgmerge-10: Likewise
+ * msgmerge-11: Likewise
+ * msgmerge-12: Likewise
+ * msgmerge-13: Likewise
+ * msgmerge-14: Likewise
+ * msgmerge-15: Likewise
+ * msgmerge-16: Likewise
+ * msgmerge-17: Likewise
+ * msgmerge-18: Likewise
+ * msgmerge-19: Likewise
+ * msgmerge-2: Likewise
+ * msgmerge-20: Likewise
+ * msgmerge-21: Likewise
+ * msgmerge-22: Likewise
+ * msgmerge-23: Likewise
+ * msgmerge-24: Likewise
+ * msgmerge-3: Likewise
+ * msgmerge-4: Likewise
+ * msgmerge-5: Likewise
+ * msgmerge-6: Likewise
+ * msgmerge-7: Likewise
+ * msgmerge-8: Likewise
+ * msgmerge-9: Likewise
+ * msgmerge-compendium-1: Likewise
+ * msgmerge-compendium-2: Likewise
+ * msgmerge-compendium-3: Likewise
+ * msgmerge-compendium-4: Likewise
+ * msgmerge-compendium-5: Likewise
+ * msgmerge-compendium-6: Likewise
+ * msgmerge-properties-1: Likewise
+ * msgmerge-properties-2: Likewise
+ * msgmerge-update-1: Likewise
+ * msgmerge-update-2: Likewise
+ * msgmerge-update-3: Likewise
+ * msgmerge-update-4: Likewise
+ * msgunfmt-1: Likewise
+ * msgunfmt-2: Likewise
+ * msgunfmt-csharp-1: Likewise
+ * msgunfmt-java-1: Likewise
+ * msgunfmt-properties-1: Likewise
+ * msgunfmt-tcl-1: Likewise
+ * msguniq-1: Likewise
+ * msguniq-2: Likewise
+ * msguniq-3: Likewise
+ * msguniq-4: Likewise
+ * msguniq-5: Likewise
+ * msguniq-6: Likewise
+ * plural-1: Likewise
+ * plural-2: Likewise
+ * recode-sr-latin-1: Likewise
+ * recode-sr-latin-2: Likewise
+ * xgettext-1: Likewise
+ * xgettext-2: Likewise
+ * xgettext-3: Likewise
+ * xgettext-4: Likewise
+ * xgettext-5: Likewise
+ * xgettext-6: Likewise
+ * xgettext-7: Likewise
+ * xgettext-8: Likewise
+ * xgettext-9: Likewise
+ * xgettext-awk-1: Likewise
+ * xgettext-awk-2: Likewise
+ * xgettext-c-1: Likewise
+ * xgettext-c-10: Likewise
+ * xgettext-c-11: Likewise
+ * xgettext-c-12: Likewise
+ * xgettext-c-13: Likewise
+ * xgettext-c-14: Likewise
+ * xgettext-c-15: Likewise
+ * xgettext-c-16: Likewise
+ * xgettext-c-17: Likewise
+ * xgettext-c-18: Likewise
+ * xgettext-c-2: Likewise
+ * xgettext-c-3: Likewise
+ * xgettext-c-4: Likewise
+ * xgettext-c-5: Likewise
+ * xgettext-c-6: Likewise
+ * xgettext-c-7: Likewise
+ * xgettext-c-8: Likewise
+ * xgettext-c-9: Likewise
+ * xgettext-csharp-1: Likewise
+ * xgettext-csharp-2: Likewise
+ * xgettext-csharp-3: Likewise
+ * xgettext-csharp-4: Likewise
+ * xgettext-csharp-5: Likewise
+ * xgettext-csharp-6: Likewise
+ * xgettext-csharp-7: Likewise
+ * xgettext-elisp-1: Likewise
+ * xgettext-elisp-2: Likewise
+ * xgettext-glade-1: Likewise
+ * xgettext-glade-2: Likewise
+ * xgettext-glade-3: Likewise
+ * xgettext-glade-4: Likewise
+ * xgettext-glade-5: Likewise
+ * xgettext-glade-6: Likewise
+ * xgettext-glade-7: Likewise
+ * xgettext-gsettings-1: Likewise
+ * xgettext-java-1: Likewise
+ * xgettext-java-2: Likewise
+ * xgettext-java-3: Likewise
+ * xgettext-java-4: Likewise
+ * xgettext-java-5: Likewise
+ * xgettext-java-6: Likewise
+ * xgettext-java-7: Likewise
+ * xgettext-javascript-1: Likewise
+ * xgettext-javascript-2: Likewise
+ * xgettext-javascript-3: Likewise
+ * xgettext-javascript-4: Likewise
+ * xgettext-javascript-5: Likewise
+ * xgettext-javascript-6: Likewise
+ * xgettext-librep-1: Likewise
+ * xgettext-librep-2: Likewise
+ * xgettext-lisp-1: Likewise
+ * xgettext-lisp-2: Likewise
+ * xgettext-lua-1: Likewise
+ * xgettext-lua-2: Likewise
+ * xgettext-objc-1: Likewise
+ * xgettext-objc-2: Likewise
+ * xgettext-perl-1: Likewise
+ * xgettext-perl-2: Likewise
+ * xgettext-perl-3: Likewise
+ * xgettext-perl-4: Likewise
+ * xgettext-perl-5: Likewise
+ * xgettext-perl-6: Likewise
+ * xgettext-perl-7: Likewise
+ * xgettext-perl-8: Likewise
+ * xgettext-php-1: Likewise
+ * xgettext-php-2: Likewise
+ * xgettext-php-3: Likewise
+ * xgettext-php-4: Likewise
+ * xgettext-po-1: Likewise
+ * xgettext-properties-1: Likewise
+ * xgettext-python-1: Likewise
+ * xgettext-python-2: Likewise
+ * xgettext-python-3: Likewise
+ * xgettext-python-4: Likewise
+ * xgettext-scheme-1: Likewise
+ * xgettext-scheme-2: Likewise
+ * xgettext-scheme-3: Likewise
+ * xgettext-sh-1: Likewise
+ * xgettext-sh-2: Likewise
+ * xgettext-sh-3: Likewise
+ * xgettext-sh-4: Likewise
+ * xgettext-sh-5: Likewise
+ * xgettext-sh-6: Likewise
+ * xgettext-smalltalk-1: Likewise
+ * xgettext-smalltalk-2: Likewise
+ * xgettext-stringtable-1: Likewise
+ * xgettext-tcl-1: Likewise
+ * xgettext-tcl-2: Likewise
+ * xgettext-tcl-3: Likewise
+ * xgettext-tcl-4: Likewise
+ * xgettext-vala-1: Likewise
+ * xgettext-ycp-1: Likewise
+ * xgettext-ycp-2: Likewise
+ * xgettext-ycp-3: Likewise
+ * xgettext-ycp-4: Likewise
+
2014-02-03 Roumen Petrov <bugtrack@roumenpetrov.info> (tiny change)
tests: pass required --tag=XX to libtool
# Test recognition of awk format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-a-1.data"
cat <<\EOF > f-a-1.data
# Valid: no argument
"abc%%"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-a-1-$n.in f-a-1-$n.po"
cat <<EOF > f-a-1-$n.in
dcgettext(${string});
EOF
rm -f f-a-1-$n.in f-a-1-$n.po
done < f-a-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of awk format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-a-2.data"
cat <<\EOF > f-a-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-a-2-$n.po f-a-2-$n.mo"
cat <<EOF > f-a-2-$n.po
#, awk-format
${msgid_line}
rm -f f-a-2-$n.po f-a-2-$n.mo
done < f-a-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Boost format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-bo-1.data"
cat <<\EOF > f-bo-1.data
# Valid: no argument
"abc%%"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-bo-1-$n.in f-bo-1-$n.po"
cat <<EOF > f-bo-1-$n.in
gettext(${string});
EOF
rm -f f-bo-1-$n.in f-bo-1-$n.po
done < f-bo-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Boost format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-bo-2.data"
cat <<\EOF > f-bo-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-bo-2-$n.po f-bo-2-$n.mo"
cat <<EOF > f-bo-2-$n.po
#, boost-format
${msgid_line}
rm -f f-bo-2-$n.po f-bo-2-$n.mo
done < f-bo-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of C format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-c-1.data"
cat <<\EOF > f-c-1.data
# Valid: no argument
"abc%%"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-c-1-$n.in f-c-1-$n.po"
cat <<EOF > f-c-1-$n.in
gettext(${string});
EOF
rm -f f-c-1-$n.in f-c-1-$n.po
done < f-c-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of C format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-c-2.data"
cat <<\EOF > f-c-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-c-2-$n.po f-c-2-$n.mo"
cat <<EOF > f-c-2-$n.po
#, c-format
${msgid_line}
rm -f f-c-2-$n.po f-c-2-$n.mo
done < f-c-2.data
-rm -fr $tmpfiles
-
exit 0
# Test ISO C 99 <inttypes.h> format string directives.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles fc3.tmp fc3.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o fc3.tmp --omit-header --no-location "$abs_srcdir"/format-c-3-prg.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < fc3.tmp > fc3.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o fc3.tmp --omit-header --no-location "$abs_srcdir"/format-c-3-prg.c || exit 1
+LC_ALL=C tr -d '\r' < fc3.tmp > fc3.pot || exit 1
-tmpfiles="$tmpfiles fc3.ok"
cat <<EOF > fc3.ok
#, c-format
msgid "father of %<PRId8> children"
: ${DIFF=diff}
${DIFF} fc3.ok fc3.pot || exit 1
-tmpfiles="$tmpfiles fc3-de.po"
cat <<EOF > fc3-de.po
#, c-format
msgid "father of %<PRId8> children"
msgstr "Vater von %<PRId8> Kindern"
EOF
-tmpfiles="$tmpfiles fc3-dir"
test -d fc3-dir || mkdir fc3-dir
test -d fc3-dir/de || mkdir fc3-dir/de
test -d fc3-dir/de/LC_MESSAGES || mkdir fc3-dir/de/LC_MESSAGES
: ${MSGFMT=msgfmt}
${MSGFMT} -o fc3-dir/de/LC_MESSAGES/fc3.mo fc3-de.po
-tmpfiles="$tmpfiles fc3-de.po.tmp fc3-de.po.un"
: ${MSGUNFMT=msgunfmt}
-${MSGUNFMT} -o fc3-de.po.tmp fc3-dir/de/LC_MESSAGES/fc3.mo
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < fc3-de.po.tmp > fc3-de.po.un
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNFMT} -o fc3-de.po.tmp fc3-dir/de/LC_MESSAGES/fc3.mo || exit 1
+LC_ALL=C tr -d '\r' < fc3-de.po.tmp > fc3-de.po.un || exit 1
: ${DIFF=diff}
${DIFF} fc3-de.po fc3-de.po.un || exit 1
LANGUAGE= ../fc3 de_DE
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test ISO C 99 <inttypes.h> format string directives with plural forms.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles fc4.tmp fc4.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o fc4.tmp --omit-header --no-location "$abs_srcdir"/format-c-4-prg.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < fc4.tmp > fc4.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o fc4.tmp --omit-header --no-location "$abs_srcdir"/format-c-4-prg.c || exit 1
+LC_ALL=C tr -d '\r' < fc4.tmp > fc4.pot || exit 1
-tmpfiles="$tmpfiles fc4.ok"
cat <<EOF > fc4.ok
#, c-format
msgid "father of %<PRId8> child"
: ${DIFF=diff}
${DIFF} fc4.ok fc4.pot || exit 1
-tmpfiles="$tmpfiles fc4-de.po"
cat <<EOF > fc4-de.po
#, c-format
msgid "father of %<PRId8> child"
msgstr[1] "Vater von %<PRId8> Kindern"
EOF
-tmpfiles="$tmpfiles fc4-dir"
test -d fc4-dir || mkdir fc4-dir
test -d fc4-dir/de || mkdir fc4-dir/de
test -d fc4-dir/de/LC_MESSAGES || mkdir fc4-dir/de/LC_MESSAGES
: ${MSGFMT=msgfmt}
${MSGFMT} -o fc4-dir/de/LC_MESSAGES/fc4.mo fc4-de.po
-tmpfiles="$tmpfiles fc4-de.po.tmp fc4-de.po.un"
: ${MSGUNFMT=msgunfmt}
-${MSGUNFMT} -o fc4-de.po.tmp fc4-dir/de/LC_MESSAGES/fc4.mo
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < fc4-de.po.tmp > fc4-de.po.un
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNFMT} -o fc4-de.po.tmp fc4-dir/de/LC_MESSAGES/fc4.mo || exit 1
+LC_ALL=C tr -d '\r' < fc4-de.po.tmp > fc4-de.po.un || exit 1
: ${DIFF=diff}
${DIFF} fc4-de.po fc4-de.po.un || exit 1
LANGUAGE= ../fc4 de_DE
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test 'I' format directive flag.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles fc5.tmp fc5.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o fc5.tmp --omit-header --no-location "$abs_srcdir"/format-c-5-prg.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < fc5.tmp > fc5.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o fc5.tmp --omit-header --no-location "$abs_srcdir"/format-c-5-prg.c || exit 1
+LC_ALL=C tr -d '\r' < fc5.tmp > fc5.pot || exit 1
-tmpfiles="$tmpfiles fc5.ok"
cat <<EOF > fc5.ok
#, c-format
msgid "father of %d children"
: ${DIFF=diff}
${DIFF} fc5.ok fc5.pot || exit 1
-tmpfiles="$tmpfiles fa.po"
# This should better be Farsi, not German. Can some translator help me?
cat <<EOF > fa.po
#, c-format
msgstr "Vater von %Id Kindern"
EOF
-tmpfiles="$tmpfiles fa"
test -d fa || mkdir fa
test -d fa/LC_MESSAGES || mkdir fa/LC_MESSAGES
: ${MSGFMT=msgfmt}
${MSGFMT} -o fa/LC_MESSAGES/fc5.mo fa.po
-tmpfiles="$tmpfiles fa.po.tmp fa.po.un"
: ${MSGUNFMT=msgunfmt}
-${MSGUNFMT} -o fa.po.tmp fa/LC_MESSAGES/fc5.mo
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < fa.po.tmp > fa.po.un
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNFMT} -o fa.po.tmp fa/LC_MESSAGES/fc5.mo || exit 1
+LC_ALL=C tr -d '\r' < fa.po.tmp > fa.po.un || exit 1
: ${DIFF=diff}
${DIFF} fa.po fa.po.un || exit 1
else
echo "Skipping test: locale fa_IR not supported"
fi
- rm -fr $tmpfiles; exit 77;;
+ exit 77;;
*) exit 1;;
esac
-rm -fr $tmpfiles
-
exit 0
# Test recognition of C# format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-cs-1.data"
cat <<\EOF > f-cs-1.data
# Valid: one argument
"abc{0}def"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-cs-1-$n.in f-cs-1-$n.po"
cat <<EOF > f-cs-1-$n.in
GetString(${string});
EOF
rm -f f-cs-1-$n.in f-cs-1-$n.po
done < f-cs-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Java format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-cs-2.data"
cat <<\EOF > f-cs-2.data
# Invalid: invalid msgstr
msgid "abc{0}def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-cs-2-$n.po f-cs-2-$n.mo"
cat <<EOF > f-cs-2-$n.po
#, csharp-format
${msgid_line}
rm -f f-cs-2-$n.po f-cs-2-$n.mo
done < f-cs-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Emacs Lisp format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-el-1.data"
cat <<\EOF > f-el-1.data
# Valid: no argument
"abc%%"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-el-1-$n.in f-el-1-$n.po"
cat <<EOF > f-el-1-$n.in
(_ ${string});
EOF
rm -f f-el-1-$n.in f-el-1-$n.po
done < f-el-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Emacs Lisp format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-el-2.data"
cat <<\EOF > f-el-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-el-2-$n.po f-el-2-$n.mo"
cat <<EOF > f-el-2-$n.po
#, elisp-format
${msgid_line}
rm -f f-el-2-$n.po f-el-2-$n.mo
done < f-el-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of GCC internal format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-gi-1.data"
cat <<\EOF > f-gi-1.data
# Valid: no argument
"abc%%"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-gi-1-$n.in f-gi-1-$n.po"
cat <<EOF > f-gi-1-$n.in
gettext(${string});
EOF
rm -f f-gi-1-$n.in f-gi-1-$n.po
done < f-gi-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of GCC internal format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-gi-2.data"
cat <<\EOF > f-gi-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-gi-2-$n.po f-gi-2-$n.mo"
cat <<EOF > f-gi-2-$n.po
#, gcc-internal-format
${msgid_line}
rm -f f-gi-2-$n.po f-gi-2-$n.mo
done < f-gi-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of GFC internal format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-gf-1.data"
cat <<\EOF > f-gf-1.data
# Valid: no argument
"abc%%"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-gf-1-$n.in f-gf-1-$n.po"
cat <<EOF > f-gf-1-$n.in
gettext(${string});
EOF
rm -f f-gf-1-$n.in f-gf-1-$n.po
done < f-gf-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of GFC internal format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-gf-2.data"
cat <<\EOF > f-gf-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-gf-2-$n.po f-gf-2-$n.mo"
cat <<EOF > f-gf-2-$n.po
#, gfc-internal-format
${msgid_line}
rm -f f-gf-2-$n.po f-gf-2-$n.mo
done < f-gf-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Java format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-j-1.data"
cat <<\EOF > f-j-1.data
# Valid: one argument
"abc{0}def"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-j-1-$n.in f-j-1-$n.po"
cat <<EOF > f-j-1-$n.in
gettext(${string});
EOF
rm -f f-j-1-$n.in f-j-1-$n.po
done < f-j-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Java format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-j-2.data"
cat <<\EOF > f-j-2.data
# Invalid: invalid msgstr
msgid "abc{0}def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-j-2-$n.po f-j-2-$n.mo"
cat <<EOF > f-j-2-$n.po
#, java-format
${msgid_line}
rm -f f-j-2-$n.po f-j-2-$n.mo
done < f-j-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of JavaScript format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-js-1.data"
cat <<\EOF > f-js-1.data
# Valid: no argument
"abc%%"
"abc%d%j%j"
EOF
-tmpfiles="$tmpfiles f-js-1.err"
: ${XGETTEXT=xgettext}
n=0
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-js-1-$n.in f-js-1-$n.po"
cat <<EOF > f-js-1-$n.in
gettext(${string});
EOF
rm -f f-js-1-$n.in f-js-1-$n.po
done < f-js-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of JavaScript format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-js-2.data"
cat <<\EOF > f-js-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-js-2-$n.po f-js-2-$n.mo"
cat <<EOF > f-js-2-$n.po
#, python-format
${msgid_line}
rm -f f-js-2-$n.po f-js-2-$n.mo
done < f-js-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of KDE format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-kd-1.data"
cat <<\EOF > f-kd-1.data
# Unrecognized: no argument
"abc%%def"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-kd-1-$n.in f-kd-1-$n.po"
cat <<EOF > f-kd-1-$n.in
_(${string});
EOF
rm -f f-kd-1-$n.in f-kd-1-$n.po
done < f-kd-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of KDE format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-kd-2.data"
cat <<\EOF > f-kd-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-kd-2-$n.po f-kd-2-$n.mo"
cat <<EOF > f-kd-2-$n.po
#, kde-format
${msgid_line}
rm -f f-kd-2-$n.po f-kd-2-$n.mo
done < f-kd-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of librep format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-lr-1.data"
cat <<\EOF > f-lr-1.data
# Valid: no argument
"abc%%"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-lr-1-$n.in f-lr-1-$n.po"
cat <<EOF > f-lr-1-$n.in
(_ ${string});
EOF
rm -f f-lr-1-$n.in f-lr-1-$n.po
done < f-lr-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of librep format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-lr-2.data"
cat <<\EOF > f-lr-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-lr-2-$n.po f-lr-2-$n.mo"
cat <<EOF > f-lr-2-$n.po
#, librep-format
${msgid_line}
rm -f f-lr-2-$n.po f-lr-2-$n.mo
done < f-lr-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Lisp format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-l-1.data"
cat <<\EOF > f-l-1.data
# Valid: no argument, ( | . *)
"abc~~def"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-l-1-$n.in f-l-1-$n.po"
cat <<EOF > f-l-1-$n.in
(gettext ${string})
EOF
rm -f f-l-1-$n.in f-l-1-$n.po
done < f-l-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Lisp format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-l-2.data"
cat <<\EOF > f-l-2.data
# Valid: ~~ doesn't count
msgid "abc~~def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-l-2-$n.po f-l-2-$n.mo"
cat <<EOF > f-l-2-$n.po
#, lisp-format
${msgid_line}
rm -f f-l-2-$n.po f-l-2-$n.mo
done < f-l-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Lua format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-lu-1.data"
cat <<\EOF > f-lu-1.data
# Valid: no argument
"abc%%"
# Invalid: unterminated
"abc%3"
EOF
-tmpfiles="$tmpfiles f-l-1.err"
: ${XGETTEXT=xgettext}
n=0
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-lu-1-$n.in f-lu-1-$n.po"
echo "gettext.gettext(${string});" > f-lu-1-$n.in
${XGETTEXT} -L Lua -o f-lu-1-$n.po f-lu-1-$n.in || exit 1
test -f f-lu-1-$n.po || exit 1
rm -f f-lu-1-$n.in f-lu-1-$n.po
done < f-lu-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Python format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-lu-2.data"
cat <<\EOF > f-lu-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-lu-2-$n.po f-lu-2-$n.mo"
cat <<EOF > f-lu-2-$n.po
#, lua-format
${msgid_line}
rm -f f-lu-2-$n.po f-lu-2-$n.mo
done < f-lu-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Object Pascal format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-op-1.data"
cat <<\EOF > f-op-1.data
# Valid: no argument
"abc%%"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-op-1-$n.in f-op-1-$n.po"
echo "x.y=${string}" | sed -e "s/\"/'/g" > f-op-1-$n.in
${XGETTEXT} -L RST -o f-op-1-$n.po f-op-1-$n.in || exit 1
test -f f-op-1-$n.po || exit 1
rm -f f-op-1-$n.in f-op-1-$n.po
done < f-op-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Object Pascal format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-op-2.data"
cat <<\EOF > f-op-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-op-2-$n.po f-op-2-$n.mo"
cat <<EOF > f-op-2-$n.po
#, object-pascal-format
${msgid_line}
rm -f f-op-2-$n.po f-op-2-$n.mo
done < f-op-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Perl format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-pl-1.data"
cat <<\EOF > f-pl-1.data
# Valid: no argument
"abc%%"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-pl-1-$n.in f-pl-1-$n.po"
sed -e 's,\$,\\$,g' <<EOF > f-pl-1-$n.in
gettext(${string});
EOF
rm -f f-pl-1-$n.in f-pl-1-$n.po
done < f-pl-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Perl format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-pl-2.data"
cat <<\EOF > f-pl-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-pl-2-$n.po f-pl-2-$n.mo"
cat <<EOF > f-pl-2-$n.po
#, perl-format
${msgid_line}
rm -f f-pl-2-$n.po f-pl-2-$n.mo
done < f-pl-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Perl brace format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-pb-1.data"
cat <<\EOF > f-pb-1.data
# Invalid: no argument
"abc"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-pb-1-$n.in f-pb-1-$n.po"
cat <<EOF > f-pb-1-$n.in
gettext(${string});
EOF
rm -f f-pb-1-$n.in f-pb-1-$n.po
done < f-pb-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Perl brace format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-pb-2.data"
cat <<\EOF > f-pb-2.data
# Valid: same named arguments
msgid "abc{date}{time}"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-pb-2-$n.po f-pb-2-$n.mo"
cat <<EOF > f-pb-2-$n.po
#, perl-brace-format
${msgid_line}
rm -f f-pb-2-$n.po f-pb-2-$n.mo
done < f-pb-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Perl format strings of both kinds (printf and brace).
# This test is for the combination of both kinds.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-pm-1.data"
cat <<\EOF > f-pm-1.data
# Both formats.
read formats
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-pm-1-$n.in f-pm-1-$n.po"
cat <<EOF > f-pm-1-$n.in
gettext(${string});
EOF
fi
done < f-pm-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Perl format strings.
# This test is for the combination of printf and brace format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-pm-2.data"
cat <<\EOF > f-pm-2.data
# Valid: normal case.
#, perl-format, perl-brace-format
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-pm-2-$n.po f-pm-2-$n.mo"
cat <<EOF > f-pm-2-$n.po
${formats}
${msgid_line}
fi
done < f-pm-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of PHP format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-ph-1.data"
cat <<\EOF > f-ph-1.data
# Valid: no argument
"abc%%"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-ph-1-$n.in f-ph-1-$n.po"
echo "<?= gettext(${string}) ?>" | sed -e 's/\$/\\\$/g' > f-ph-1-$n.in
${XGETTEXT} -L PHP -o f-ph-1-$n.po f-ph-1-$n.in || exit 1
test -f f-ph-1-$n.po || exit 1
rm -f f-ph-1-$n.in f-ph-1-$n.po
done < f-ph-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of PHP format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-ph-2.data"
cat <<\EOF > f-ph-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-ph-2-$n.po f-ph-2-$n.mo"
cat <<EOF > f-ph-2-$n.po
#, php-format
${msgid_line}
rm -f f-ph-2-$n.po f-ph-2-$n.mo
done < f-ph-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Python format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-p-1.data"
cat <<\EOF > f-p-1.data
# Valid: no argument
"abc%%"
"abc%(addr).*x"
EOF
-tmpfiles="$tmpfiles f-p-1.err"
: ${XGETTEXT=xgettext}
n=0
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-p-1-$n.in f-p-1-$n.po"
cat <<EOF > f-p-1-$n.in
gettext(${string});
EOF
rm -f f-p-1-$n.in f-p-1-$n.po
done < f-p-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Python format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-p-2.data"
cat <<\EOF > f-p-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-p-2-$n.po f-p-2-$n.mo"
cat <<EOF > f-p-2-$n.po
#, python-format
${msgid_line}
rm -f f-p-2-$n.po f-p-2-$n.mo
done < f-p-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Python brace format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-pyb-1.data"
cat <<\EOF > f-pyb-1.data
# Invalid: no argument
"abc"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-pyb-1-$n.in f-pyb-1-$n.po"
cat <<EOF > f-pyb-1-$n.in
gettext(${string});
EOF
rm -f f-pyb-1-$n.in f-pyb-1-$n.po
done < f-pyb-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Python brace format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-pyb-2.data"
cat <<\EOF > f-pyb-2.data
# Valid: same named arguments
msgid "abc{date}{time}"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-pyb-2-$n.po f-pyb-2-$n.mo"
cat <<EOF > f-pyb-2-$n.po
#, python-brace-format
${msgid_line}
rm -f f-pyb-2-$n.po f-pyb-2-$n.mo
done < f-pyb-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Qt format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-qt-1.data"
cat <<\EOF > f-qt-1.data
# Unrecognized: no argument
"abc%%def"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-qt-1-$n.in f-qt-1-$n.po"
cat <<EOF > f-qt-1-$n.in
_(${string});
EOF
rm -f f-qt-1-$n.in f-qt-1-$n.po
done < f-qt-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Qt format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-qt-2.data"
cat <<\EOF > f-qt-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-qt-2-$n.po f-qt-2-$n.mo"
cat <<EOF > f-qt-2-$n.po
#, qt-format
${msgid_line}
rm -f f-qt-2-$n.po f-qt-2-$n.mo
done < f-qt-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Qt plural format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-qtp-1.data"
cat <<\EOF > f-qtp-1.data
# Unrecognized: no argument
"abcdef"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-qtp-1-$n.in f-qtp-1-$n.po"
cat <<EOF > f-qtp-1-$n.in
_(${string});
EOF
rm -f f-qtp-1-$n.in f-qtp-1-$n.po
done < f-qtp-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Qt plural format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-qtp-2.data"
cat <<\EOF > f-qtp-2.data
# Valid: %1 doesn't count
msgid "abc%1def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-qtp-2-$n.po f-qtp-2-$n.mo"
cat <<EOF > f-qtp-2-$n.po
#, qt-plural-format
${msgid_line}
rm -f f-qtp-2-$n.po f-qtp-2-$n.mo
done < f-qtp-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Scheme format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-sc-1.data"
cat <<\EOF > f-sc-1.data
# Valid: no argument, ( | . *)
"abc~~def"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-sc-1-$n.in f-sc-1-$n.po"
cat <<EOF > f-sc-1-$n.in
(gettext ${string})
EOF
rm -f f-sc-1-$n.in f-sc-1-$n.po
done < f-sc-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Lisp format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-sc-2.data"
cat <<\EOF > f-sc-2.data
# Valid: ~~ doesn't count
msgid "abc~~def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-sc-2-$n.po f-sc-2-$n.mo"
cat <<EOF > f-sc-2-$n.po
#, scheme-format
${msgid_line}
rm -f f-sc-2-$n.po f-sc-2-$n.mo
done < f-sc-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Shell format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-sh-1.data"
cat <<\EOF > f-sh-1.data
# Invalid: no argument
"abc"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-sh-1-$n.in f-sh-1-$n.po"
sed -e 's,\$,\\$,g' <<EOF > f-sh-1-$n.in
gettext ${string};
EOF
rm -f f-sh-1-$n.in f-sh-1-$n.po
done < f-sh-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Shell format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-sh-2.data"
cat <<\EOF > f-sh-2.data
# Invalid: invalid msgstr
msgid "abc$file"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-sh-2-$n.po f-sh-2-$n.mo"
cat <<EOF > f-sh-2-$n.po
#, sh-format
${msgid_line}
rm -f f-sh-2-$n.po f-sh-2-$n.mo
done < f-sh-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of Tcl format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-t-1.data"
cat <<\EOF > f-t-1.data
# Valid: no argument
"abc%%"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-t-1-$n.in f-t-1-$n.po"
escape_dollars='s/\$/\\\$/g'
string=`echo "$string" | sed -e "$escape_dollars"`
cat <<EOF > f-t-1-$n.in
rm -f f-t-1-$n.in f-t-1-$n.po
done < f-t-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of Tcl format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-t-2.data"
cat <<\EOF > f-t-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-t-2-$n.po f-t-2-$n.mo"
cat <<EOF > f-t-2-$n.po
#, tcl-format
${msgid_line}
rm -f f-t-2-$n.po f-t-2-$n.mo
done < f-t-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recognition of YCP format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-y-1.data"
cat <<\EOF > f-y-1.data
# Valid: no argument
"abc%%def"
while read comment; do
read string
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-y-1-$n.in f-y-1-$n.po"
cat <<EOF > f-y-1-$n.in
_(${string});
EOF
rm -f f-y-1-$n.in f-y-1-$n.po
done < f-y-1.data
-rm -fr $tmpfiles
-
exit 0
# Test checking of YCP format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-y-2.data"
cat <<\EOF > f-y-2.data
# Valid: %% doesn't count
msgid "abc%%def"
read msgid_line
read msgstr_line
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-y-2-$n.po f-y-2-$n.mo"
cat <<EOF > f-y-2-$n.po
#, ycp-format
${msgid_line}
rm -f f-y-2-$n.po f-y-2-$n.mo
done < f-y-2.data
-rm -fr $tmpfiles
-
exit 0
# Test the gettext program with -e option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# Create binary test file in correct position.
-tmpfiles="$tmpfiles gt-1"
test -d gt-1 || mkdir gt-1
test -d gt-1/LC_MESSAGES || mkdir gt-1/LC_MESSAGES
cp "$abs_srcdir"/test.mo gt-1/LC_MESSAGES
-tmpfiles="$tmpfiles gt-test1.out"
: ${GETTEXT=gettext}
TEXTDOMAINDIR=. LANGUAGE=gt-1 \
${GETTEXT} --env LC_ALL=en -e test 'SYS_(C)\n' | LC_ALL=C tr -d '\r' > gt-test1.out
# Create correct file.
-tmpfile="$tmpfiles gtmf-test1.ok"
cat <<EOF > gtmf-test1.ok
MSGFMT(1) portable message object file compiler
Copyright (C) 1995 Free Software Foundation
${DIFF} gtmf-test1.ok gt-test1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
ac_n= ac_c='\c' ac_t=
fi
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# Create binary test file in correct position.
-tmpfiles="$tmpfiles gt-2"
test -d gt-2 || mkdir gt-2
test -d gt-2/LC_MESSAGES || mkdir gt-2/LC_MESSAGES
cp "$abs_srcdir"/test.mo gt-2/LC_MESSAGES
-tmpfiles="$tmpfiles gt-test2.out"
: ${GETTEXT=gettext}
TEXTDOMAINDIR=. LANGUAGE=gt-2 \
${GETTEXT} --env LC_ALL=en test 'error 3' > gt-test2.out
# Create correct file.
-tmpfile="$tmpfiles gtmf-test2.ok"
echo $ac_n "error 3 translation$ac_c" > gtmf-test2.ok
: ${DIFF=diff}
${DIFF} gtmf-test2.ok gt-test2.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test that on glibc systems, gettext() works right even with intermediate
# setlocale() calls.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# This test works only on glibc systems.
: ${GLIBC2=no}
test "$GLIBC2" = yes || {
exit 77
}
-tmpfiles="$tmpfiles gt-3"
test -d gt-3 || mkdir gt-3
test -d gt-3/de_DE || mkdir gt-3/de_DE
test -d gt-3/de_DE/LC_MESSAGES || mkdir gt-3/de_DE/LC_MESSAGES
${MSGFMT} -o gt-3/de_DE/LC_MESSAGES/tstlang.mo "$abs_srcdir"/gettext-3-1.po
${MSGFMT} -o gt-3/fr_FR/LC_MESSAGES/tstlang.mo "$abs_srcdir"/gettext-3-2.po
-tmpfiles="$tmpfiles gt-3.ok"
cat <<EOF > gt-3.ok
String1 - Lang1: 1st string
String2 - Lang1: 2nd string
String2 - Another string for testing.
EOF
-tmpfiles="$tmpfiles gt-3.out"
../gettext-3-prg > gt-3.out || exit 1
: ${DIFF=diff}
${DIFF} gt-3.ok gt-3.out || exit 1
-rm -fr $tmpfiles
-
exit 0
# Test that bind_textdomain_codeset() works.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# This test works only on systems that have a traditional french locale
# installed.
# gettext-4.po is actually a German PO file, but only the encoding of the
exit 77
}
-tmpfiles="$tmpfiles gt-4"
test -d gt-4 || mkdir gt-4
test -d gt-4/fr || mkdir gt-4/fr
test -d gt-4/fr/LC_MESSAGES || mkdir gt-4/fr/LC_MESSAGES
../gettext-4-prg $LOCALE_FR || exit 1
-rm -fr $tmpfiles
-
exit 0
# Test that on glibc systems, the gettext() results come out in the correct
# encoding for locales that differ only in their encoding.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# This test works only on glibc systems.
: ${GLIBC2=no}
test "$GLIBC2" = yes || {
exit 77
}
-tmpfiles="$tmpfiles gt-5"
test -d gt-5 || mkdir gt-5
test -d gt-5/de_DE || mkdir gt-5/de_DE
test -d gt-5/de_DE/LC_MESSAGES || mkdir gt-5/de_DE/LC_MESSAGES
../gettext-5-prg || exit 1
-rm -fr $tmpfiles
-
exit 0
# correctly if different threads operate in different locales with the same
# encoding.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# This test works only on glibc and MacOS X systems.
: ${host_os=unknown}
: ${GLIBC2=no}
exit 77
fi
-tmpfiles="$tmpfiles gt-6"
test -d gt-6 || mkdir gt-6
test -d gt-6/de_DE || mkdir gt-6/de_DE
test -d gt-6/de_DE/LC_MESSAGES || mkdir gt-6/de_DE/LC_MESSAGES
${MSGFMT} -o gt-6/de_DE/LC_MESSAGES/tstthread.mo "$abs_srcdir"/gettext-6-1.po
${MSGFMT} -o gt-6/fr_FR/LC_MESSAGES/tstthread.mo "$abs_srcdir"/gettext-6-2.po
-tmpfiles="$tmpfiles gt-6.ok"
cat <<EOF > gt-6.ok
Schönheit
beauté
beauté
EOF
-tmpfiles="$tmpfiles gt-6.out"
../gettext-6-prg > gt-6.out
case $? in
0) ;;
77)
echo "Skipping test: not a glibc >= 2.3 or MacOS X >= 10.5 system"
- rm -fr $tmpfiles; exit 77
+ exit 77
;;
esac
: ${DIFF=diff}
${DIFF} gt-6.ok gt-6.out || exit 1
-rm -fr $tmpfiles
-
exit 0
# correctly if different threads operate in different locales referring to
# the same catalog file but with different encodings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# This test works only on glibc and MacOS X systems.
: ${host_os=unknown}
: ${GLIBC2=no}
exit 77
fi
-tmpfiles="$tmpfiles gt-7"
test -d gt-7 || mkdir gt-7
test -d gt-7/de_DE || mkdir gt-7/de_DE
test -d gt-7/de_DE/LC_MESSAGES || mkdir gt-7/de_DE/LC_MESSAGES
: ${MSGFMT=msgfmt}
${MSGFMT} -o gt-7/de_DE/LC_MESSAGES/tstthread.mo "$abs_srcdir"/gettext-7.po
-tmpfiles="$tmpfiles gt-7.out"
../gettext-7-prg > gt-7.out
case $? in
0) ;;
77)
echo "Skipping test: not a glibc >= 2.3 or MacOS X >= 10.5 system"
- rm -fr $tmpfiles; exit 77
+ exit 77
;;
*)
exit 1
;;
esac
-rm -fr $tmpfiles
-
exit 0
. "${srcdir=.}/init.sh"; path_prepend_ . ../src
# Test the libgettextpo library.
-tmpfiles="gtpo-1-copied.po gtpo-1-created.po"
-../gettextpo-1-prg${EXEEXT} "$abs_srcdir"/gettextpo-1.de.po > /dev/null
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+../gettextpo-1-prg${EXEEXT} "$abs_srcdir"/gettextpo-1.de.po > /dev/null || exit 1
: ${DIFF=diff}
-${DIFF} "$abs_srcdir"/gettextpo-1.de.po gtpo-1-copied.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-${DIFF} "$abs_srcdir"/gettextpo-1.de.po gtpo-1-created.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-
-rm -f $tmpfiles
+${DIFF} "$abs_srcdir"/gettextpo-1.de.po gtpo-1-copied.po || exit 1
+${DIFF} "$abs_srcdir"/gettextpo-1.de.po gtpo-1-created.po || exit 1
exit 0
# output when accessing any .mo file not generated from a .po file in UTF-8
# encoding.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles prog.bash"
cat <<\EOF > prog.bash
#! /bin/bash
$echo "`eval_ngettext "a piece of cake" "\\$n pieces of cake" $n`"
EOF
-tmpfiles="$tmpfiles l-bash-prog.tmp l-bash-prog.pot l-bash-prog.err"
: ${XGETTEXT=xgettext}
LC_MESSAGES=C LC_ALL= \
${XGETTEXT} -o l-bash-prog.tmp --omit-header --no-location prog.bash \
>l-bash-prog.err 2>&1
result=$?
cat l-bash-prog.err | grep -v 'warning: the syntax \$"\.\.\." is deprecated due to security reasons'
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-bash-prog.tmp > l-bash-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < l-bash-prog.tmp > l-bash-prog.pot || exit 1
-tmpfiles="$tmpfiles l-bash-prog.ok"
cat <<\EOF > l-bash-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-bash-prog.ok l-bash-prog.pot || exit 1
-tmpfiles="$tmpfiles l-bash-fr.po"
cat <<\EOF > l-bash-fr.po
msgid ""
msgstr ""
msgstr[1] "$n morceaux de gateau"
EOF
-tmpfiles="$tmpfiles l-bash-fr.po.tmp l-bash-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-bash-fr.po.tmp l-bash-fr.po l-bash-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-bash-fr.po.tmp > l-bash-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-bash-fr.po.tmp l-bash-fr.po l-bash-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-bash-fr.po.tmp > l-bash-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-bash-fr.po l-bash-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-bash"
test -d l-bash || mkdir l-bash
test -d l-bash/fr || mkdir l-bash/fr
test -d l-bash/fr/LC_MESSAGES || mkdir l-bash/fr/LC_MESSAGES
# Test for presence of bash version 2.0 or newer.
(bash -c :) >/dev/null 2>/dev/null \
- || { echo "Skipping test: bash not found"; rm -fr $tmpfiles; exit 77; }
+ || { echo "Skipping test: bash not found"; exit 77; }
case `bash -c 'echo $BASH_VERSION'` in
[2-9].*) ;;
- *) echo "Skipping test: bash version too old"; rm -fr $tmpfiles; exit 77;;
+ *) echo "Skipping test: bash version too old"; exit 77;;
esac
# Test which of the fr_FR locales are installed.
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-tmpfiles="$tmpfiles l-bash-prog.nok l-bash-prog.ok l-bash-prog.oku l-bash-prog.out"
# Expected result when bash is built without i18n support.
cat <<\EOF > l-bash-prog.nok
'Your command, please?', asked the waiter.
: ${DIFF=diff}
${DIFF} l-bash-prog.nok l-bash-prog.out > /dev/null && {
echo "Skipping test: bash is built without i18n support"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
${DIFF} l-bash-prog.ok l-bash-prog.out || exit 1
fi
: ${DIFF=diff}
${DIFF} l-bash-prog.nok l-bash-prog.out > /dev/null && {
echo "Skipping test: bash is built without i18n support"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
${DIFF} l-bash-prog.oku l-bash-prog.out || exit 1
fi
-rm -fr $tmpfiles
-
exit 0
# Assumes an fr_FR locale is installed.
# Assumes the following packages are installed: gcc.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles prog.c"
cat <<\EOF > prog.c
#include "config.h"
#include <libintl.h>
}
EOF
-tmpfiles="$tmpfiles l-c-prog.${OBJEXT} l-c-prog${EXEEXT}"
# Put the -I flags before ${CFLAGS} ${CPPFLAGS}, to make sure that libintl.h
# is found in the build directory, regardless of -I options present in
# ${CFLAGS} or ${CPPFLAGS}.
${LIBTOOL} --quiet --tag=CC --mode=link ${CC} -I../.. -I"$abs_top_srcdir"/gnulib-lib ../../gnulib-lib/libgettextlib.la -I../../intl ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o l-c-prog prog.c ${LTLIBINTL} \
|| exit 1
-tmpfiles="$tmpfiles l-c-prog.tmp l-c-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-c-prog.tmp --omit-header --no-location -k_ prog.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-c-prog.tmp > l-c-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-c-prog.tmp --omit-header --no-location -k_ prog.c || exit 1
+LC_ALL=C tr -d '\r' < l-c-prog.tmp > l-c-prog.pot || exit 1
-tmpfiles="$tmpfiles l-c-prog.ok"
cat <<EOF > l-c-prog.ok
#, c-format
msgid "'Your command, please?', asked the waiter."
: ${DIFF=diff}
${DIFF} l-c-prog.ok l-c-prog.pot || exit 1
-tmpfiles="$tmpfiles l-c-fr.po"
cat <<\EOF > l-c-fr.po
msgid ""
msgstr ""
msgstr "%2$s remplace %1$s."
EOF
-tmpfiles="$tmpfiles l-c-fr.po.tmp l-c-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-c-fr.po.tmp l-c-fr.po l-c-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-c-fr.po.tmp > l-c-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-c-fr.po.tmp l-c-fr.po l-c-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-c-fr.po.tmp > l-c-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-c-fr.po l-c-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-c"
test -d l-c || mkdir l-c
test -d l-c/fr || mkdir l-c/fr
test -d l-c/fr/LC_MESSAGES || mkdir l-c/fr/LC_MESSAGES
: ${MSGFMT=msgfmt}
${MSGFMT} -o l-c/fr/LC_MESSAGES/prog.mo l-c-fr.po
-tmpfiles="$tmpfiles l-c-prog.ok l-c-prog.oku l-c-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-c-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-rm -fr $tmpfiles
-
exit 0
# Assumes an fr_FR locale is installed.
# Assumes the following packages are installed: gcc g++.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# Test whether a C++ compiler is found and libasprintf is built.
test "${CXX}" != ":" || {
echo "Skipping test: no C++ compiler found"
exit 77
}
-tmpfiles="$tmpfiles l-c++-prog.cc"
cat <<\EOF > l-c++-prog.cc
#include "config.h"
}
EOF
-tmpfiles="$tmpfiles l-c++-prog.${OBJEXT} l-c++-prog${EXEEXT}"
# Compile in two steps from .cc to .o and from .o to 'l-c++-prog'. This way,
# relinking is faster because doesn't need to redo the first step.
# Put the -I flags before ${CXXFLAGS} ${CPPFLAGS}, to make sure that libintl.h
${LIBTOOL} --quiet --tag=CXX --mode=link --tag=CXX ${CXX} ${CXXFLAGS} `echo "X ${LDFLAGS} " | sed -e 's/^X//' -e 's/ -Wl,--disable-auto-import / /'` -o l-c++-prog l-c++-prog.${OBJEXT} ../../../gettext-runtime/libasprintf/libasprintf.la ../../gnulib-lib/libgettextlib.la ${LTLIBINTL} \
|| exit 1
-tmpfiles="$tmpfiles l-c++-prog.tmp l-c++-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-c++-prog.tmp --omit-header --no-location -k_ l-c++-prog.cc
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-c++-prog.tmp > l-c++-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-c++-prog.tmp --omit-header --no-location -k_ l-c++-prog.cc || exit 1
+LC_ALL=C tr -d '\r' < l-c++-prog.tmp > l-c++-prog.pot || exit 1
-tmpfiles="$tmpfiles l-c++-prog.ok"
cat <<EOF > l-c++-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-c++-prog.ok l-c++-prog.pot || exit 1
-tmpfiles="$tmpfiles l-c++-fr.po"
cat <<\EOF > l-c++-fr.po
msgid ""
msgstr ""
msgstr "%2$s remplace %1$s."
EOF
-tmpfiles="$tmpfiles l-c++-fr.po.tmp l-c++-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-c++-fr.po.tmp l-c++-fr.po l-c++-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-c++-fr.po.tmp > l-c++-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-c++-fr.po.tmp l-c++-fr.po l-c++-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-c++-fr.po.tmp > l-c++-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-c++-fr.po l-c++-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-c++"
test -d l-c++ || mkdir l-c++
test -d l-c++/fr || mkdir l-c++/fr
test -d l-c++/fr/LC_MESSAGES || mkdir l-c++/fr/LC_MESSAGES
: ${MSGFMT=msgfmt}
${MSGFMT} -o l-c++/fr/LC_MESSAGES/prog.mo l-c++-fr.po
-tmpfiles="$tmpfiles l-c++-prog.ok l-c++-prog.oku l-c++-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-c++-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-rm -fr $tmpfiles
-
exit 0
# Assumes an fr_FR locale is installed.
# Assumes the following packages are installed: clisp.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles prog.lisp"
cat <<\EOF > prog.lisp
(setf (textdomain) "prog")
(setf (textdomaindir "prog") "./l-clisp/")
(format t "~A~%" (format nil (gettext "~A is replaced by ~A.") "FF" "EUR"))
EOF
-tmpfiles="$tmpfiles l-clisp-prog.tmp l-clisp-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-clisp-prog.tmp --omit-header --no-location prog.lisp
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-clisp-prog.tmp > l-clisp-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-clisp-prog.tmp --omit-header --no-location prog.lisp || exit 1
+LC_ALL=C tr -d '\r' < l-clisp-prog.tmp > l-clisp-prog.pot || exit 1
-tmpfiles="$tmpfiles l-clisp-prog.ok"
cat <<EOF > l-clisp-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-clisp-prog.ok l-clisp-prog.pot || exit 1
-tmpfiles="$tmpfiles l-clisp-fr.po"
cat <<\EOF > l-clisp-fr.po
msgid ""
msgstr ""
msgstr "~1@*~A remplace ~0@*~A."
EOF
-tmpfiles="$tmpfiles l-clisp-fr.po.tmp l-clisp-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-clisp-fr.po.tmp l-clisp-fr.po l-clisp-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-clisp-fr.po.tmp > l-clisp-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-clisp-fr.po.tmp l-clisp-fr.po l-clisp-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-clisp-fr.po.tmp > l-clisp-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-clisp-fr.po l-clisp-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-clisp"
test -d l-clisp || mkdir l-clisp
test -d l-clisp/fr || mkdir l-clisp/fr
test -d l-clisp/fr/LC_MESSAGES || mkdir l-clisp/fr/LC_MESSAGES
# Use clisp for the comparison of the version numbers; neither 'expr' nor 'bc'
# can deal with floating-point numbers.
(clisp --version) >/dev/null 2>/dev/null \
- || { echo "Skipping test: clisp not found"; rm -fr $tmpfiles; exit 77; }
+ || { echo "Skipping test: clisp not found"; exit 77; }
version=`clisp --version | sed -n -e 1p | sed -e 's/^[^0-9]*//'`
case $version in
19* | 20*) # older than 2.25
- echo "Skipping test: clisp version too old"; rm -fr $tmpfiles; exit 77;;
+ echo "Skipping test: clisp version too old"; exit 77;;
esac
version=`echo $version | sed -e 's/^\([0-9]*\.[0-9]*\).*/\1/'`
clisp -norc -x "(sys::exit #+GETTEXT (not (>= $version 2.28)) #-GETTEXT t)" \
>/dev/null \
|| { echo "Skipping test: clisp was built without gettext support"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
# Test which of the fr_FR locales are installed.
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-tmpfiles="$tmpfiles l-clisp-prog.ok l-clisp-prog.oku l-clisp-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-clisp-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
${DIFF} l-clisp-prog.oku l-clisp-prog.out || exit 1
fi
-rm -fr $tmpfiles
-
exit 0
# are wrong for locales containing a language and a territory. This is fixed
# in mono-0.29.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# Test whether we can build and test C# programs.
test "${CSHARP_CHOICE}" != no || {
echo "Skipping test: configured with --disable-csharp"
exit 77
}
-tmpfiles="$tmpfiles program.cs"
cat <<\EOF > program.cs
using System;
using GNU.Gettext;
}
EOF
-tmpfiles="$tmpfiles l-csharp"
test -d l-csharp || mkdir l-csharp
: ${CSHARPCOMP="/bin/sh ../../csharpcomp.sh"}
${CSHARPCOMP} -o l-csharp/program.exe -L ../../../gettext-runtime/intl-csharp -l GNU.Gettext program.cs || exit 1
-tmpfiles="$tmpfiles l-csharp-prog.tmp l-csharp-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-csharp-prog.tmp --omit-header --no-location program.cs
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-csharp-prog.tmp > l-csharp-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-csharp-prog.tmp --omit-header --no-location program.cs || exit 1
+LC_ALL=C tr -d '\r' < l-csharp-prog.tmp > l-csharp-prog.pot || exit 1
-tmpfiles="$tmpfiles l-csharp-prog.ok"
cat <<EOF > l-csharp-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-csharp-prog.ok l-csharp-prog.pot || exit 1
-tmpfiles="$tmpfiles l-csharp-fr.po"
cat <<\EOF > l-csharp-fr.po
msgid ""
msgstr ""
msgstr "Le nouveau {1} remplace le vieux {0}."
EOF
-tmpfiles="$tmpfiles l-csharp-fr.po.tmp l-csharp-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-csharp-fr.po.tmp l-csharp-fr.po l-csharp-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-csharp-fr.po.tmp > l-csharp-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-csharp-fr.po.tmp l-csharp-fr.po l-csharp-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-csharp-fr.po.tmp > l-csharp-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-csharp-fr.po l-csharp-fr.po.new || exit 1
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-tmpfiles="$tmpfiles l-csharp-prog.ok l-csharp-prog.oku l-csharp-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-csharp-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
${DIFF} l-csharp-prog.oku l-csharp-prog.out || exit 1
fi
-rm -fr $tmpfiles
-
exit 0
# Test of gettext facilities in the Emacs Lisp language.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles prog.el"
cat <<\EOF > prog.el
(textdomain "prog")
(bindtextdomain "prog" "l-elisp")
(format nil (_ "%s is replaced by %s.") "FF" "EUR"))
EOF
-tmpfiles="$tmpfiles l-elisp-prog.tmp l-elisp-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-elisp-prog.tmp --omit-header --no-location prog.el
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-elisp-prog.tmp > l-elisp-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-elisp-prog.tmp --omit-header --no-location prog.el || exit 1
+LC_ALL=C tr -d '\r' < l-elisp-prog.tmp > l-elisp-prog.pot || exit 1
-tmpfiles="$tmpfiles l-elisp-prog.ok"
cat <<EOF > l-elisp-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-elisp-prog.ok l-elisp-prog.pot || exit 1
-tmpfiles="$tmpfiles l-elisp-fr.po"
cat <<\EOF > l-elisp-fr.po
msgid ""
msgstr ""
msgstr "%2$s remplace %1$s."
EOF
-tmpfiles="$tmpfiles l-elisp-fr.po.tmp l-elisp-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-elisp-fr.po.tmp l-elisp-fr.po l-elisp-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-elisp-fr.po.tmp > l-elisp-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-elisp-fr.po.tmp l-elisp-fr.po l-elisp-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-elisp-fr.po.tmp > l-elisp-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-elisp-fr.po l-elisp-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-elisp"
test -d l-elisp || mkdir l-elisp
test -d l-elisp/fr || mkdir l-elisp/fr
test -d l-elisp/fr/LC_MESSAGES || mkdir l-elisp/fr/LC_MESSAGES
: ${MSGFMT=msgfmt}
${MSGFMT} -o l-elisp/fr/LC_MESSAGES/prog.mo l-elisp-fr.po
-rm -fr $tmpfiles
-
exit 0
# but not in the fr_FR.UTF-8 locale. Probably because in the fr_FR locale,
# nl_langinfo(CODESET) returns "".
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles prog.awk"
cat <<\EOF > prog.awk
BEGIN {
TEXTDOMAIN = "prog"
}
EOF
-tmpfiles="$tmpfiles l-gawk-prog.tmp l-gawk-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-gawk-prog.tmp --omit-header --no-location prog.awk
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-gawk-prog.tmp > l-gawk-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-gawk-prog.tmp --omit-header --no-location prog.awk || exit 1
+LC_ALL=C tr -d '\r' < l-gawk-prog.tmp > l-gawk-prog.pot || exit 1
-tmpfiles="$tmpfiles l-gawk-prog.ok"
cat <<EOF > l-gawk-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-gawk-prog.ok l-gawk-prog.pot || exit 1
-tmpfiles="$tmpfiles l-gawk-fr.po"
cat <<\EOF > l-gawk-fr.po
msgid ""
msgstr ""
msgstr "%2$s remplace %1$s."
EOF
-tmpfiles="$tmpfiles l-gawk-fr.po.tmp l-gawk-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-gawk-fr.po.tmp l-gawk-fr.po l-gawk-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-gawk-fr.po.tmp > l-gawk-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-gawk-fr.po.tmp l-gawk-fr.po l-gawk-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-gawk-fr.po.tmp > l-gawk-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-gawk-fr.po l-gawk-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-gawk"
test -d l-gawk || mkdir l-gawk
test -d l-gawk/fr || mkdir l-gawk/fr
test -d l-gawk/fr/LC_MESSAGES || mkdir l-gawk/fr/LC_MESSAGES
# Test for presence of gawk version 3.1.3 or newer, excluding version 3.1.5.
(gawk --version) >/dev/null 2>/dev/null \
- || { echo "Skipping test: gawk not found"; rm -fr $tmpfiles; exit 77; }
+ || { echo "Skipping test: gawk not found"; exit 77; }
case `gawk --version 2>&1 | sed -e 's/^[^0-9]*//'` in
0.* | 1.* | 2.* | 3.0* | 3.1.0* | 3.1.1* | 3.1.2* | 3.1.5*)
- echo "Skipping test: gawk version too old"; rm -fr $tmpfiles; exit 77;;
+ echo "Skipping test: gawk version too old"; exit 77;;
esac
# Test which of the fr_FR locales are installed.
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
# Test that gawk wasn't built with --disable-nls.
LANGUAGE= LC_ALL=$LOCALE_FR gawk --version | grep logiciel > /dev/null
test $? = 0 || {
echo "Skipping test: gawk was built without i18n support"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
fi
if test $LOCALE_FR_UTF8 != none; then
LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 gawk --version | grep logiciel > /dev/null
test $? = 0 || {
echo "Skipping test: gawk was built without i18n support"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
fi
-tmpfiles="$tmpfiles l-gawk-prog.ok l-gawk-prog.oku l-gawk-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-gawk-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
${DIFF} l-gawk-prog.oku l-gawk-prog.out || exit 1
fi
-rm -fr $tmpfiles
-
exit 0
# Assumes an fr_FR locale is installed.
# Assumes the following packages are installed: guile.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles prog.scm"
cat <<\EOF > prog.scm
(use-modules (ice-9 format))
(format #t "~A~%" (format #f (gettext "~A is replaced by ~A.") "FF" "EUR"))
EOF
-tmpfiles="$tmpfiles l-guile-prog.tmp l-guile-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-guile-prog.tmp --omit-header --no-location prog.scm
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-guile-prog.tmp > l-guile-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-guile-prog.tmp --omit-header --no-location prog.scm || exit 1
+LC_ALL=C tr -d '\r' < l-guile-prog.tmp > l-guile-prog.pot || exit 1
-tmpfiles="$tmpfiles l-guile-prog.ok"
cat <<EOF > l-guile-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-guile-prog.ok l-guile-prog.pot || exit 1
-tmpfiles="$tmpfiles l-guile-fr.po"
cat <<\EOF > l-guile-fr.po
msgid ""
msgstr ""
msgstr "~1@*~A remplace ~0@*~A."
EOF
-tmpfiles="$tmpfiles l-guile-fr.po.tmp l-guile-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-guile-fr.po.tmp l-guile-fr.po l-guile-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-guile-fr.po.tmp > l-guile-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-guile-fr.po.tmp l-guile-fr.po l-guile-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-guile-fr.po.tmp > l-guile-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-guile-fr.po l-guile-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-guile"
test -d l-guile || mkdir l-guile
test -d l-guile/fr || mkdir l-guile/fr
test -d l-guile/fr/LC_MESSAGES || mkdir l-guile/fr/LC_MESSAGES
# Test for presence of guile version 1.7 or newer.
(guile --version) >/dev/null 2>/dev/null \
- || { echo "Skipping test: guile not found"; rm -fr $tmpfiles; exit 77; }
+ || { echo "Skipping test: guile not found"; exit 77; }
case `guile --version | sed -e 1q | sed -e 's/^[^0-9]*//'` in
0.* | 1.[0-6] | 1.[0-6].* )
- echo "Skipping test: guile version too old"; rm -fr $tmpfiles; exit 77;;
+ echo "Skipping test: guile version too old"; exit 77;;
esac
# Test which of the fr_FR locales are installed.
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-tmpfiles="$tmpfiles l-guile-prog.ok l-guile-prog.oku l-guile-prog.out l-guile-prog.err"
: ${DIFF=diff}
cat <<\EOF > l-guile-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
${DIFF} l-guile-prog.oku l-guile-prog.out || exit 1
fi
-rm -fr $tmpfiles
-
exit 0
# Note: This test fails when using gcj from GCC 3.1 and GCC 3.2, due to a bug
# (libgcj/6576). It is fixed in GCC 3.3.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# Test whether we can build and test Java programs.
test "${JAVA_CHOICE}" != no || {
echo "Skipping test: configured with --disable-java"
exit 77
}
-tmpfiles="$tmpfiles Program.java"
cat <<\EOF > Program.java
import java.util.*;
import java.io.*;
}
EOF
-tmpfiles="$tmpfiles Program.class l-java l-java-prog.err"
test -d l-java || mkdir l-java
: ${JAVACOMP="/bin/sh ../../javacomp.sh"}
CLASSPATH=../../../gettext-runtime/intl-java/libintl.jar ${JAVACOMP} -d l-java Program.java 2>l-java-prog.err \
|| { cat l-java-prog.err 1>&2; exit 1; }
-tmpfiles="$tmpfiles l-java-prog.tmp l-java-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-java-prog.tmp --omit-header --no-location Program.java
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-java-prog.tmp > l-java-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-java-prog.tmp --omit-header --no-location Program.java || exit 1
+LC_ALL=C tr -d '\r' < l-java-prog.tmp > l-java-prog.pot || exit 1
-tmpfiles="$tmpfiles l-java-prog.ok"
cat <<EOF > l-java-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-java-prog.ok l-java-prog.pot || exit 1
-tmpfiles="$tmpfiles l-java-fr.po"
cat <<\EOF > l-java-fr.po
msgid ""
msgstr ""
msgstr "Le nouveau {1} remplace le vieux {0}."
EOF
-tmpfiles="$tmpfiles l-java-fr.po.tmp l-java-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-java-fr.po.tmp l-java-fr.po l-java-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-java-fr.po.tmp > l-java-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-java-fr.po.tmp l-java-fr.po l-java-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-java-fr.po.tmp > l-java-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-java-fr.po l-java-fr.po.new || exit 1
-tmpfiles="$tmpfiles prog_fr.class"
: ${MSGFMT=msgfmt}
${MSGFMT} -j -d l-java -r prog -l fr l-java-fr.po || exit 1
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-tmpfiles="$tmpfiles l-java-prog.ok l-java-prog.oku l-java-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-java-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
${DIFF} l-java-prog.oku l-java-prog.out || exit 1
fi
-rm -fr $tmpfiles
-
exit 0
# Assumes an fr_FR locale is installed.
# Assumes the following packages are installed: gjs.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles prog.js"
cat <<\EOF > prog.js
const Format = imports.format;
const Gettext = imports.gettext;
print(_("%s is replaced by %s.").format("FF", "EUR"));
EOF
-tmpfiles="$tmpfiles l-javascript-prog.tmp l-javascript-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-javascript-prog.tmp --omit-header --no-location prog.js
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-javascript-prog.tmp > l-javascript-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-javascript-prog.tmp --omit-header --no-location prog.js || exit 1
+LC_ALL=C tr -d '\r' < l-javascript-prog.tmp > l-javascript-prog.pot || exit 1
-tmpfiles="$tmpfiles l-javascript-prog.ok"
cat <<EOF > l-javascript-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-javascript-prog.ok l-javascript-prog.pot || exit 1
-tmpfiles="$tmpfiles l-javascript-fr.po"
cat <<\EOF > l-javascript-fr.po
msgid ""
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
msgstr "%s remplace %s."
EOF
-tmpfiles="$tmpfiles l-javascript-fr.po.tmp l-javascript-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-javascript-fr.po.tmp l-javascript-fr.po l-javascript-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-javascript-fr.po.tmp > l-javascript-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-javascript-fr.po.tmp l-javascript-fr.po l-javascript-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-javascript-fr.po.tmp > l-javascript-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-javascript-fr.po l-javascript-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-javascript"
test -d l-javascript || mkdir l-javascript
test -d l-javascript/fr || mkdir l-javascript/fr
test -d l-javascript/fr/LC_MESSAGES || mkdir l-javascript/fr/LC_MESSAGES
# Test for presence of gjs.
(gjs -h) >/dev/null 2>/dev/null \
- || { echo "Skipping test: gjs not found"; rm -fr $tmpfiles; exit 77; }
+ || { echo "Skipping test: gjs not found"; exit 77; }
(gjs -c imports.gettext) >/dev/null 2>/dev/null \
- || { echo "Skipping test: gjs gettext module not found"; rm -fr $tmpfiles; exit 77; }
+ || { echo "Skipping test: gjs gettext module not found"; exit 77; }
(gjs -c imports.format) >/dev/null 2>/dev/null \
- || { echo "Skipping test: gjs format module not found"; rm -fr $tmpfiles; exit 77; }
+ || { echo "Skipping test: gjs format module not found"; exit 77; }
# Test which of the fr_FR locales are installed.
: ${LOCALE_FR=fr_FR}
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-tmpfiles="$tmpfiles l-javascript-prog.ok l-javascript-prog.oku l-javascript-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-javascript-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
${DIFF} -u l-javascript-prog.oku l-javascript-prog.out || exit 1
fi
-rm -fr $tmpfiles
-
exit 0
# Assumes an fr_FR locale is installed.
# Assumes the following packages are installed: librep.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles prog.jl"
cat <<\EOF > prog.jl
(require 'rep.i18n.gettext)
(format nil (_ "%s is replaced by %s.") "FF" "EUR"))
EOF
-tmpfiles="$tmpfiles l-librep-prog.tmp l-librep-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-librep-prog.tmp --omit-header --no-location prog.jl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-librep-prog.tmp > l-librep-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-librep-prog.tmp --omit-header --no-location prog.jl || exit 1
+LC_ALL=C tr -d '\r' < l-librep-prog.tmp > l-librep-prog.pot || exit 1
-tmpfiles="$tmpfiles l-librep-prog.ok"
cat <<EOF > l-librep-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-librep-prog.ok l-librep-prog.pot || exit 1
-tmpfiles="$tmpfiles l-librep-fr.po"
cat <<\EOF > l-librep-fr.po
msgid ""
msgstr ""
msgstr "%2$s remplace %1$s."
EOF
-tmpfiles="$tmpfiles l-librep-fr.po.tmp l-librep-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-librep-fr.po.tmp l-librep-fr.po l-librep-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-librep-fr.po.tmp > l-librep-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-librep-fr.po.tmp l-librep-fr.po l-librep-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-librep-fr.po.tmp > l-librep-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-librep-fr.po l-librep-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-librep"
test -d l-librep || mkdir l-librep
test -d l-librep/fr || mkdir l-librep/fr
test -d l-librep/fr/LC_MESSAGES || mkdir l-librep/fr/LC_MESSAGES
# Test for presence of rep version 0.15.3 or newer.
(rep --version) >/dev/null 2>/dev/null \
- || { echo "Skipping test: rep not found"; rm -fr $tmpfiles; exit 77; }
+ || { echo "Skipping test: rep not found"; exit 77; }
case `rep --version | sed -e 's/^[^0-9]*//'` in
0.[0-9] | 0.1[0-5] | 0.[0-9].* | 0.1[0-4].* | 0.15.[0-2] )
- echo "Skipping test: rep version too old"; rm -fr $tmpfiles; exit 77;;
+ echo "Skipping test: rep version too old"; exit 77;;
esac
# Test which of the fr_FR locales are installed.
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-tmpfiles="$tmpfiles l-librep-prog.ok l-librep-prog.oku l-librep-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-librep-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
${DIFF} l-librep-prog.oku l-librep-prog.out || exit 1
fi
-rm -fr $tmpfiles
-
exit 0
# 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")
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 ""
: ${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 ""
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
# 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.
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.
${DIFF} l-lua-prog.oku l-lua-prog.out || exit 1
fi
-rm -fr $tmpfiles
-
exit 0
# Assumes an fr_FR locale is installed.
# Assumes the following packages are installed: gcc.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# Test whether an ObjectiveC compiler is found.
-tmpfiles="$tmpfiles hello.m l-objc-hello.${OBJEXT} l-objc-hello${EXEEXT} l-objc-hello.dSYM"
cat <<\EOF > hello.m
#include <stdio.h>
#include <stdlib.h>
EOF
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o l-objc-hello hello.m 2>/dev/null \
|| { echo "Skipping test: Objective C compiler not found"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles prog.m"
cat <<\EOF > prog.m
#include "config.h"
#include <libintl.h>
}
EOF
-tmpfiles="$tmpfiles l-objc-prog.${OBJEXT} l-objc-prog${EXEEXT}"
# Put the -I flags before ${CFLAGS} ${CPPFLAGS}, to make sure that libintl.h
# is found in the build directory, regardless of -I options present in
# ${CFLAGS} or ${CPPFLAGS}.
${LIBTOOL} --quiet --tag=CC --mode=link ${CC} -I../.. -I"$abs_top_srcdir"/gnulib-lib ../../gnulib-lib/libgettextlib.la -I../../intl ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o l-objc-prog prog.m ${LTLIBINTL} \
|| exit 1
-tmpfiles="$tmpfiles l-objc-prog.tmp l-objc-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-objc-prog.tmp --omit-header --no-location -k_ prog.m
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-objc-prog.tmp > l-objc-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-objc-prog.tmp --omit-header --no-location -k_ prog.m || exit 1
+LC_ALL=C tr -d '\r' < l-objc-prog.tmp > l-objc-prog.pot || exit 1
-tmpfiles="$tmpfiles l-objc-prog.ok"
cat <<EOF > l-objc-prog.ok
#, c-format
msgid "'Your command, please?', asked the waiter."
: ${DIFF=diff}
${DIFF} l-objc-prog.ok l-objc-prog.pot || exit 1
-tmpfiles="$tmpfiles l-objc-fr.po"
cat <<\EOF > l-objc-fr.po
msgid ""
msgstr ""
msgstr "%2$s remplace %1$s."
EOF
-tmpfiles="$tmpfiles l-objc-fr.po.tmp l-objc-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-objc-fr.po.tmp l-objc-fr.po l-objc-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-objc-fr.po.tmp > l-objc-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-objc-fr.po.tmp l-objc-fr.po l-objc-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-objc-fr.po.tmp > l-objc-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-objc-fr.po l-objc-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-objc"
test -d l-objc || mkdir l-objc
test -d l-objc/fr || mkdir l-objc/fr
test -d l-objc/fr/LC_MESSAGES || mkdir l-objc/fr/LC_MESSAGES
: ${MSGFMT=msgfmt}
${MSGFMT} -o l-objc/fr/LC_MESSAGES/prog.mo l-objc-fr.po
-tmpfiles="$tmpfiles l-objc-prog.ok l-objc-prog.oku l-objc-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-objc-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-rm -fr $tmpfiles
-
exit 0
# This here is a quick workaround:
UTF8_LOCALE_UNSUPPORTED=yes
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles pascalprog.pp"
cat <<\EOF > pascalprog.pp
program pascalprog;
{$mode delphi}
end.
EOF
-tmpfiles="$tmpfiles pascalprog.o pascalprog.rst pascalprog"
(ppc386 pascalprog.pp) >/dev/null 2>&1 ||
(ppcx64 pascalprog.pp) >/dev/null 2>&1 ||
{
echo "Skipping test: Pascal compiler ppc386 or ppcx64 not found"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles l-pascal-pascalprog.tmp l-pascal-pascalprog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-pascal-pascalprog.tmp --omit-header --add-location pascalprog.rst
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-pascal-pascalprog.tmp > l-pascal-pascalprog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-pascal-pascalprog.tmp --omit-header --add-location pascalprog.rst || exit 1
+LC_ALL=C tr -d '\r' < l-pascal-pascalprog.tmp > l-pascal-pascalprog.pot || exit 1
-tmpfiles="$tmpfiles l-pascal-pascalprog.ok"
cat <<EOF > l-pascal-pascalprog.ok
#: pascalprog.question
msgid "'Your command, please?', asked the waiter."
: ${DIFF=diff}
${DIFF} l-pascal-pascalprog.ok l-pascal-pascalprog.pot || exit 1
-tmpfiles="$tmpfiles l-pascal-fr.po"
cat <<\EOF > l-pascal-fr.po
msgid ""
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
msgstr "%1:s remplace %0:s."
EOF
-tmpfiles="$tmpfiles l-pascal-fr.po.tmp l-pascal-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-pascal-fr.po.tmp l-pascal-fr.po l-pascal-pascalprog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-pascal-fr.po.tmp > l-pascal-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-pascal-fr.po.tmp l-pascal-fr.po l-pascal-pascalprog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-pascal-fr.po.tmp > l-pascal-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-pascal-fr.po l-pascal-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-pascal"
test -d l-pascal || mkdir l-pascal
test -d l-pascal/fr || mkdir l-pascal/fr
test -d l-pascal/fr/LC_MESSAGES || mkdir l-pascal/fr/LC_MESSAGES
: ${MSGFMT=msgfmt}
${MSGFMT} -o l-pascal/fr/LC_MESSAGES/pascalprog.mo l-pascal-fr.po
-tmpfiles="$tmpfiles l-pascal-pascalprog.ok l-pascal-pascalprog.oku l-pascal-pascalprog.out"
: ${DIFF=diff}
cat <<\EOF > l-pascal-pascalprog.ok
«Votre commande, s'il vous plait», dit le garçon.
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
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
# Assumes an fr_FR locale is installed.
# Assumes the following packages are installed: perl.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles program1.pl"
cat <<\EOF > program1.pl
use strict;
print "\n";
EOF
-tmpfiles="$tmpfiles l-perl-1-prog.tmp l-perl-1-prog.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} \
-k__ --flag=__:1:pass-perl-format --flag=__:1:pass-perl-brace-format \
- -o l-perl-1-prog.tmp --omit-header --no-location program1.pl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-perl-1-prog.tmp > l-perl-1-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -o l-perl-1-prog.tmp --omit-header --no-location program1.pl || exit 1
+LC_ALL=C tr -d '\r' < l-perl-1-prog.tmp > l-perl-1-prog.pot || exit 1
-tmpfiles="$tmpfiles l-perl-1-prog.ok"
cat <<EOF > l-perl-1-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-perl-1-prog.ok l-perl-1-prog.pot || exit 1
-tmpfiles="$tmpfiles l-perl-1-fr.po"
cat <<\EOF > l-perl-1-fr.po
msgid ""
msgstr ""
msgstr "%2$s remplace %1$s."
EOF
-tmpfiles="$tmpfiles l-perl-1-fr.po.tmp l-perl-1-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-perl-1-fr.po.tmp l-perl-1-fr.po l-perl-1-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-perl-1-fr.po.tmp > l-perl-1-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-perl-1-fr.po.tmp l-perl-1-fr.po l-perl-1-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-perl-1-fr.po.tmp > l-perl-1-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-perl-1-fr.po l-perl-1-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-perl-1"
test -d l-perl-1 || mkdir l-perl-1
test -d l-perl-1/fr || mkdir l-perl-1/fr
test -d l-perl-1/fr/LC_MESSAGES || mkdir l-perl-1/fr/LC_MESSAGES
: ${MSGFMT=msgfmt}
${MSGFMT} -o l-perl-1/fr/LC_MESSAGES/prog.mo l-perl-1-fr.po
-tmpfiles="$tmpfiles l-perl-1-prog.ok l-perl-1-prog.oku l-perl-1-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-perl-1-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
# Test for perl with Locale::Messages package.
perl -e 'use Locale::Messages;' 2>/dev/null \
|| { echo "Skipping test: perl package Locale::Messages is not installed"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
: ${LOCALE_FR=fr_FR}
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-rm -fr $tmpfiles
-
exit 0
# Assumes an fr_FR locale is installed.
# Assumes the following packages are installed: perl, libintl-perl.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles program2.pl"
cat <<\EOF > program2.pl
use Locale::TextDomain (prog => './l-perl-2');
my $n = 2;
print "\n";
EOF
-tmpfiles="$tmpfiles l-perl-2-prog.tmp l-perl-2-prog.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} \
-k__ --flag=__:1:pass-perl-format --flag=__:1:pass-perl-brace-format \
-k__n:1,2 --flag=__n:1:pass-perl-format --flag=__n:1:pass-perl-brace-format \
--flag=__n:2:pass-perl-format --flag=__n:2:pass-perl-brace-format \
-k__x --flag=__x:1:perl-brace-format \
- -o l-perl-2-prog.tmp --omit-header --no-location program2.pl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-perl-2-prog.tmp > l-perl-2-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -o l-perl-2-prog.tmp --omit-header --no-location program2.pl || exit 1
+LC_ALL=C tr -d '\r' < l-perl-2-prog.tmp > l-perl-2-prog.pot || exit 1
-tmpfiles="$tmpfiles l-perl-2-prog.ok"
cat <<EOF > l-perl-2-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-perl-2-prog.ok l-perl-2-prog.pot || exit 1
-tmpfiles="$tmpfiles l-perl-2-fr.po"
cat <<\EOF > l-perl-2-fr.po
msgid ""
msgstr ""
msgstr "{new} remplace {old}."
EOF
-tmpfiles="$tmpfiles l-perl-2-fr.po.tmp l-perl-2-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-perl-2-fr.po.tmp l-perl-2-fr.po l-perl-2-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-perl-2-fr.po.tmp > l-perl-2-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-perl-2-fr.po.tmp l-perl-2-fr.po l-perl-2-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-perl-2-fr.po.tmp > l-perl-2-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-perl-2-fr.po l-perl-2-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-perl-2"
test -d l-perl-2 || mkdir l-perl-2
test -d l-perl-2/fr || mkdir l-perl-2/fr
test -d l-perl-2/fr/LC_MESSAGES || mkdir l-perl-2/fr/LC_MESSAGES
: ${MSGFMT=msgfmt}
${MSGFMT} -o l-perl-2/fr/LC_MESSAGES/prog.mo l-perl-2-fr.po
-tmpfiles="$tmpfiles l-perl-2-prog.ok l-perl-2-prog.oku l-perl-2-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-perl-2-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
# Test for perl with libintl-perl package.
perl -M'Locale::TextDomain' -e '' 2>/dev/null \
|| { echo "Skipping test: perl package libintl-perl is not installed"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
: ${LOCALE_FR=fr_FR}
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-rm -fr $tmpfiles
-
exit 0
# Assumes an fr_FR locale is installed.
# Assumes the following packages are installed: mod_php4-core.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles prog.php"
cat <<\EOF > prog.php
<?php
setlocale (LC_ALL, "");
?>
EOF
-tmpfiles="$tmpfiles l-php-prog.tmp l-php-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-php-prog.tmp --omit-header --no-location prog.php
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-php-prog.tmp > l-php-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-php-prog.tmp --omit-header --no-location prog.php || exit 1
+LC_ALL=C tr -d '\r' < l-php-prog.tmp > l-php-prog.pot || exit 1
-tmpfiles="$tmpfiles l-php-prog.ok"
cat <<EOF > l-php-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-php-prog.ok l-php-prog.pot || exit 1
-tmpfiles="$tmpfiles l-php-fr.po"
cat <<\EOF > l-php-fr.po
msgid ""
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
msgstr "%2$s remplace %1$s."
EOF
-tmpfiles="$tmpfiles l-php-fr.po.tmp l-php-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-php-fr.po.tmp l-php-fr.po l-php-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-php-fr.po.tmp > l-php-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-php-fr.po.tmp l-php-fr.po l-php-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-php-fr.po.tmp > l-php-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-php-fr.po l-php-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-php"
test -d l-php || mkdir l-php
test -d l-php/fr || mkdir l-php/fr
test -d l-php/fr/LC_MESSAGES || mkdir l-php/fr/LC_MESSAGES
# Test for presence of php version 4.0 or newer with gettext support.
(php -v) >/dev/null 2>/dev/null
test $? -le 1 \
- || { echo "Skipping test: php not found"; rm -fr $tmpfiles; exit 77; }
+ || { echo "Skipping test: php not found"; exit 77; }
case `php -v | sed -n -e 1p | sed -e 's/^[^0-9]*//'` in
[4-9].*) ;;
- *) echo "Skipping test: php version too old"; rm -fr $tmpfiles; exit 77;;
+ *) echo "Skipping test: php version too old"; exit 77;;
esac
{ php -m | grep '^gettext$' >/dev/null; } \
|| { echo "Skipping test: php was built without gettext support"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
# Test which of the fr_FR locales are installed.
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-tmpfiles="$tmpfiles l-php-prog.ok l-php-prog.oku l-php-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-php-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
${DIFF} l-php-prog.oku l-php-prog.out || exit 1
fi
-rm -fr $tmpfiles
-
exit 0
# Test of gettext facilities in the PO/POT format.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# Test with POT format.
-tmpfiles="$tmpfiles prog-in.pot"
cat <<\EOF > prog-in.pot
msgid "'Your command, please?', asked the waiter."
msgstr ""
msgstr ""
EOF
-tmpfiles="$tmpfiles l-po-prog.tmp l-po-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-po-prog.tmp --omit-header --add-location prog-in.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-po-prog.tmp > l-po-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-po-prog.tmp --omit-header --add-location prog-in.pot || exit 1
+LC_ALL=C tr -d '\r' < l-po-prog.tmp > l-po-prog.pot || exit 1
: ${DIFF=diff}
${DIFF} prog-in.pot l-po-prog.pot || exit 1
# Test with PO format.
-tmpfiles="$tmpfiles l-po-prog-in.po"
cat <<\EOF > l-po-prog-in.po
msgid ""
msgstr ""
msgstr "%2$s remplace %1$s."
EOF
-tmpfiles="$tmpfiles l-po-prog.tmp.po l-po-prog.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-po-prog.tmp.po --omit-header --add-location l-po-prog-in.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-po-prog.tmp.po > l-po-prog.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-po-prog.tmp.po --omit-header --add-location l-po-prog-in.po || exit 1
+LC_ALL=C tr -d '\r' < l-po-prog.tmp.po > l-po-prog.po || exit 1
: ${DIFF=diff}
${DIFF} l-po-prog-in.po l-po-prog.po || exit 1
-rm -fr $tmpfiles
-
exit 0
# 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 prog1.py"
cat <<\EOF > prog1.py
import gettext
% { 'oldCurrency': "FF", 'newCurrency' : "EUR" }
EOF
-tmpfiles="$tmpfiles l-python-1-prog.tmp l-python-1-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-python-1-prog.tmp --omit-header --no-location prog1.py
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-python-1-prog.tmp > l-python-1-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-python-1-prog.tmp --omit-header --no-location prog1.py || exit 1
+LC_ALL=C tr -d '\r' < l-python-1-prog.tmp > l-python-1-prog.pot || exit 1
-tmpfiles="$tmpfiles l-python-1-prog.ok"
cat <<EOF > l-python-1-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-python-1-prog.ok l-python-1-prog.pot || exit 1
-tmpfiles="$tmpfiles l-python-1-fr.po"
cat <<\EOF > l-python-1-fr.po
msgid ""
msgstr ""
msgstr "%(newCurrency)s remplace %(oldCurrency)s."
EOF
-tmpfiles="$tmpfiles l-python-1-fr.po.tmp l-python-1-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-python-1-fr.po.tmp l-python-1-fr.po l-python-1-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-python-1-fr.po.tmp > l-python-1-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-python-1-fr.po.tmp l-python-1-fr.po l-python-1-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-python-1-fr.po.tmp > l-python-1-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-python-1-fr.po l-python-1-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-python-1"
test -d l-python-1 || mkdir l-python-1
test -d l-python-1/fr || mkdir l-python-1/fr
test -d l-python-1/fr/LC_MESSAGES || mkdir l-python-1/fr/LC_MESSAGES
# Test for presence of python version 2.0 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 >= 0x20000F0'` 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-1-prog.ok l-python-1-prog.oku l-python-1-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-python-1-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
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
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
# 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
% { '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 ""
: ${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 ""
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
# 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.
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
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
# Test of gettext facilities in the RST format.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles prog.rst"
cat <<\EOF > prog.rst
# From the rstconv program itself.
rstconv.help='rstconv [-h|--help] Displays this help'#10+
rstconv.InvalidOutputFormat='Invalid output format -'
EOF
-tmpfiles="$tmpfiles l-rst-prog.tmp l-rst-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-rst-prog.tmp --omit-header --add-location prog.rst
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-rst-prog.tmp > l-rst-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-rst-prog.tmp --omit-header --add-location prog.rst || exit 1
+LC_ALL=C tr -d '\r' < l-rst-prog.tmp > l-rst-prog.pot || exit 1
-tmpfiles="$tmpfiles l-rst-prog.ok"
cat <<EOF > l-rst-prog.ok
#: rstconv.help
msgid ""
# - no line wrapping in fpc versions < 2.6.0
# - extra newline at the end
-tmpfiles="$tmpfiles l-rst-prog.pot"
: ${RSTCONV=rstconv}
if (${RSTCONV} -o l-rst-prog.pot -i prog.rst) >/dev/null 2>&1; then
-tmpfiles="$tmpfiles l-rst-prog.ok1"
cat <<EOF > l-rst-prog.ok1
#: rstconv:help
msgid "rstconv [-h|--help] Displays this help\nrstconv options Convert rst file\n\nOptions are:\n -i file Use specified file instead of stdin as input .rst (OPTIONAL)\n -o file Write output to specified file (REQUIRED)\n -f format Specifies the output format:\n po GNU gettext .po (portable) format (DEFAULT)\n"
EOF
-tmpfiles="$tmpfiles l-rst-prog.ok2"
cat <<EOF > l-rst-prog.ok2
#: rstconv:help
msgid ""
fi
-rm -fr $tmpfiles
-
exit 0
# Note: This test fails on BeOS because there all locales use the UTF-8
# encoding, even the locale fr_FR, thus the output comes out in UTF-8.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles prog.sh"
cat <<\EOF > prog.sh
#! /bin/sh
$echo "`eval_ngettext \"a piece of cake\" \"\\$n pieces of cake\" $n`"
EOF
-tmpfiles="$tmpfiles l-sh-prog.tmp l-sh-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-sh-prog.tmp --omit-header --no-location prog.sh
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-sh-prog.tmp > l-sh-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-sh-prog.tmp --omit-header --no-location prog.sh || exit 1
+LC_ALL=C tr -d '\r' < l-sh-prog.tmp > l-sh-prog.pot || exit 1
-tmpfiles="$tmpfiles l-sh-prog.ok"
cat <<\EOF > l-sh-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-sh-prog.ok l-sh-prog.pot || exit 1
-tmpfiles="$tmpfiles l-sh-fr.po"
cat <<\EOF > l-sh-fr.po
msgid ""
msgstr ""
msgstr[1] "$n morceaux de gateau"
EOF
-tmpfiles="$tmpfiles l-sh-fr.po.tmp l-sh-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-sh-fr.po.tmp l-sh-fr.po l-sh-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-sh-fr.po.tmp > l-sh-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-sh-fr.po.tmp l-sh-fr.po l-sh-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-sh-fr.po.tmp > l-sh-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-sh-fr.po l-sh-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-sh"
test -d l-sh || mkdir l-sh
test -d l-sh/fr || mkdir l-sh/fr
test -d l-sh/fr/LC_MESSAGES || mkdir l-sh/fr/LC_MESSAGES
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-tmpfiles="$tmpfiles l-sh-prog.ok l-sh-prog.oku l-sh-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-sh-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
${DIFF} l-sh-prog.oku l-sh-prog.out || exit 1
fi
-rm -fr $tmpfiles
-
exit 0
# Assumes an fr_FR locale is installed.
# Assumes the following packages are installed: smalltalk.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles prog.st"
cat <<\EOF > prog.st
PackageLoader fileInPackage: 'I18N' !
Main new run!
EOF
-tmpfiles="$tmpfiles l-smalltalk-prog.tmp l-smalltalk-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-smalltalk-prog.tmp --omit-header --no-location prog.st
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-smalltalk-prog.tmp > l-smalltalk-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-smalltalk-prog.tmp --omit-header --no-location prog.st || exit 1
+LC_ALL=C tr -d '\r' < l-smalltalk-prog.tmp > l-smalltalk-prog.pot || exit 1
-tmpfiles="$tmpfiles l-smalltalk-prog.ok"
cat <<EOF > l-smalltalk-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-smalltalk-prog.ok l-smalltalk-prog.pot || exit 1
-tmpfiles="$tmpfiles l-smalltalk-fr.po"
cat <<\EOF > l-smalltalk-fr.po
msgid ""
msgstr ""
msgstr "%2 remplace %1."
EOF
-tmpfiles="$tmpfiles l-smalltalk-fr.po.tmp l-smalltalk-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-smalltalk-fr.po.tmp l-smalltalk-fr.po l-smalltalk-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-smalltalk-fr.po.tmp > l-smalltalk-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-smalltalk-fr.po.tmp l-smalltalk-fr.po l-smalltalk-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-smalltalk-fr.po.tmp > l-smalltalk-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-smalltalk-fr.po l-smalltalk-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-smalltalk"
test -d l-smalltalk || mkdir l-smalltalk
test -d l-smalltalk/fr || mkdir l-smalltalk/fr
test -d l-smalltalk/fr/LC_MESSAGES || mkdir l-smalltalk/fr/LC_MESSAGES
# Test for presence of gst version 2.0.6 or newer.
(gst --version) >/dev/null 2>/dev/null \
- || { echo "Skipping test: gst not found"; rm -fr $tmpfiles; exit 77; }
+ || { echo "Skipping test: gst not found"; exit 77; }
case `gst --version | sed -n -e 1p | sed -e 's/^[^0-9]*//'` in
0.* | 1.* | 2.0 | 2.0.[0-5] | 2.1 | 2.1.[0-1])
- echo "Skipping test: gst version too old"; rm -fr $tmpfiles; exit 77;;
+ echo "Skipping test: gst version too old"; exit 77;;
esac
-tmpfiles="$tmpfiles l-smalltalk-prog.ok l-smalltalk-prog.oku l-smalltalk-prog.ok2 l-smalltalk-prog.oku2 l-smalltalk-prog.ok3 l-smalltalk-prog.oku3 l-smalltalk-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-smalltalk-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-rm -fr $tmpfiles
-
exit 0
# Note: This test fails on Cygwin 1.7.2 in the fr_FR.UTF-8 locale but not
# in the fr_FR.ISO-8859-1 locale.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles program.tcl"
cat <<\EOF > program.tcl
#!/usr/bin/env tclsh
package require msgcat
puts [format [::msgcat::mc "%s is replaced by %s."] "FF" "EUR"]
EOF
-tmpfiles="$tmpfiles l-tcl-prog.tmp l-tcl-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-tcl-prog.tmp --omit-header -k_ program.tcl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-tcl-prog.tmp > l-tcl-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-tcl-prog.tmp --omit-header -k_ program.tcl || exit 1
+LC_ALL=C tr -d '\r' < l-tcl-prog.tmp > l-tcl-prog.pot || exit 1
-tmpfiles="$tmpfiles l-tcl-prog.ok"
cat <<EOF > l-tcl-prog.ok
#: program.tcl:5
msgid "'Your command, please?', asked the waiter."
: ${DIFF=diff}
${DIFF} l-tcl-prog.ok l-tcl-prog.pot || exit 1
-tmpfiles="$tmpfiles l-tcl-fr.po"
cat <<\EOF > l-tcl-fr.po
msgid ""
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
msgstr "%2$s remplace %1$s."
EOF
-tmpfiles="$tmpfiles l-tcl-fr.po.tmp l-tcl-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-tcl-fr.po.tmp l-tcl-fr.po l-tcl-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-tcl-fr.po.tmp > l-tcl-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-tcl-fr.po.tmp l-tcl-fr.po l-tcl-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-tcl-fr.po.tmp > l-tcl-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-tcl-fr.po l-tcl-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-tcl"
test -d l-tcl || mkdir l-tcl
test -d l-tcl/msgs || mkdir l-tcl/msgs
${MSGFMT} --tcl -d l-tcl/msgs -l fr l-tcl-fr.po || exit 1
# Test for presence of tclsh with msgcat extension.
-tmpfiles="$tmpfiles l-tcl-version.tcl"
cat <<\EOF > l-tcl-version.tcl
package require msgcat
puts $tcl_version
EOF
(tclsh l-tcl-version.tcl) >/dev/null 2>/dev/null \
|| { echo "Skipping test: tclsh not found or msgcat extension not present"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles l-tcl-prog.ok l-tcl-prog.oku l-tcl-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-tcl-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-rm -fr $tmpfiles
-
exit 0
# Assumes an fr_FR locale is installed.
# Assumes the following packages are installed: vala.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles l-vala-prog.vala"
cat <<\EOF > l-vala-prog.vala
int main (string[] args) {
Intl.setlocale (LocaleCategory.ALL, "");
# Test for presence of valac.
(valac --version) >/dev/null 2>/dev/null
test $? -le 1 \
- || { echo "Skipping test: valac not found"; rm -fr $tmpfiles; exit 77; }
+ || { echo "Skipping test: valac not found"; exit 77; }
-tmpfiles="$tmpfiles l-vala-prog.vala l-vala-prog.c l-vala-prog l-vala-prog.err"
: ${VALAC=valac}
${VALAC} --Xcc=-DGETTEXT_PACKAGE=\"prog\" l-vala-prog.vala 2>l-vala-prog.err \
|| { cat l-vala-prog.err 1>&2; exit 1; }
-tmpfiles="$tmpfiles l-vala-prog.tmp l-vala-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-vala-prog.tmp --omit-header --no-location l-vala-prog.vala
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-vala-prog.tmp > l-vala-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-vala-prog.tmp --omit-header --no-location l-vala-prog.vala || exit 1
+LC_ALL=C tr -d '\r' < l-vala-prog.tmp > l-vala-prog.pot || exit 1
-tmpfiles="$tmpfiles l-vala-prog.ok"
cat <<EOF > l-vala-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-vala-prog.ok l-vala-prog.pot || exit 1
-tmpfiles="$tmpfiles l-vala-fr.po"
cat <<\EOF > l-vala-fr.po
msgid ""
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
msgstr "%2$s remplace %1$s."
EOF
-tmpfiles="$tmpfiles l-vala-fr.po.tmp l-vala-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-vala-fr.po.tmp l-vala-fr.po l-vala-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-vala-fr.po.tmp > l-vala-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-vala-fr.po.tmp l-vala-fr.po l-vala-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-vala-fr.po.tmp > l-vala-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-vala-fr.po l-vala-fr.po.new || exit 1
-tmpfiles="$tmpfiles l-vala"
test -d l-vala || mkdir l-vala
test -d l-vala/fr || mkdir l-vala/fr
test -d l-vala/fr/LC_MESSAGES || mkdir l-vala/fr/LC_MESSAGES
: ${MSGFMT=msgfmt}
${MSGFMT} -o l-vala/fr/LC_MESSAGES/prog.mo l-vala-fr.po
-tmpfiles="$tmpfiles l-vala-prog.ok l-vala-prog.oku l-vala-prog.out"
: ${DIFF=diff}
cat <<\EOF > l-vala-prog.ok
«Votre commande, s'il vous plait», dit le garçon.
else
echo "Skipping test: no french locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-rm -fr $tmpfiles
-
exit 0
# Test of gettext facilities in the YCP language.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles prog.ycp"
cat <<\EOF > prog.ycp
{
textdomain "prog";
}
EOF
-tmpfiles="$tmpfiles l-ycp-prog.tmp l-ycp-prog.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o l-ycp-prog.tmp --omit-header --no-location prog.ycp
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-ycp-prog.tmp > l-ycp-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o l-ycp-prog.tmp --omit-header --no-location prog.ycp || exit 1
+LC_ALL=C tr -d '\r' < l-ycp-prog.tmp > l-ycp-prog.pot || exit 1
-tmpfiles="$tmpfiles l-ycp-prog.ok"
cat <<EOF > l-ycp-prog.ok
msgid "'Your command, please?', asked the waiter."
msgstr ""
: ${DIFF=diff}
${DIFF} l-ycp-prog.ok l-ycp-prog.pot || exit 1
-tmpfiles="$tmpfiles l-ycp-fr.po"
cat <<\EOF > l-ycp-fr.po
msgid ""
msgstr ""
msgstr "%2 remplace %1."
EOF
-tmpfiles="$tmpfiles l-ycp-fr.po.tmp l-ycp-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o l-ycp-fr.po.tmp l-ycp-fr.po l-ycp-prog.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < l-ycp-fr.po.tmp > l-ycp-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o l-ycp-fr.po.tmp l-ycp-fr.po l-ycp-prog.pot || exit 1
+LC_ALL=C tr -d '\r' < l-ycp-fr.po.tmp > l-ycp-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} l-ycp-fr.po l-ycp-fr.po.new || exit 1
-rm -fr $tmpfiles
-
exit 0
# Test --translated option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test1.po"
cat <<\EOF > ma-test1.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles ma-test1.tmp ma-test1.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --translated -o ma-test1.tmp ma-test1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test1.tmp > ma-test1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --translated -o ma-test1.tmp ma-test1.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test1.tmp > ma-test1.out || exit 1
-tmpfiles="$tmpfiles ma-test1.ok"
cat <<\EOF > ma-test1.ok
# HEADER.
#
${DIFF} ma-test1.ok ma-test1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --set-obsolete option. Note that the output routines drop untranslated
# obsolete messages.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test10.po"
cat <<\EOF > ma-test10.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles ma-test10.tmp ma-test10.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --set-obsolete -o ma-test10.tmp ma-test10.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test10.tmp > ma-test10.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --set-obsolete -o ma-test10.tmp ma-test10.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test10.tmp > ma-test10.out || exit 1
-tmpfiles="$tmpfiles ma-test10.ok"
cat <<\EOF > ma-test10.ok
# HEADER.
#
${DIFF} ma-test10.ok ma-test10.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --clear-obsolete option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test11.po"
cat <<\EOF > ma-test11.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles ma-test11.tmp ma-test11.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --clear-obsolete -o ma-test11.tmp ma-test11.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test11.tmp > ma-test11.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --clear-obsolete -o ma-test11.tmp ma-test11.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test11.tmp > ma-test11.out || exit 1
-tmpfiles="$tmpfiles ma-test11.ok"
cat <<\EOF > ma-test11.ok
# HEADER.
#
${DIFF} ma-test11.ok ma-test11.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --fuzzy option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test12.po"
cat <<\EOF > ma-test12.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles ma-test12.tmp ma-test12.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --fuzzy -o ma-test12.tmp ma-test12.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test12.tmp > ma-test12.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --fuzzy -o ma-test12.tmp ma-test12.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test12.tmp > ma-test12.out || exit 1
-tmpfiles="$tmpfiles ma-test12.ok"
cat <<\EOF > ma-test12.ok
# HEADER.
#
${DIFF} ma-test12.ok ma-test12.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --obsolete option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test13.po"
cat <<\EOF > ma-test13.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles ma-test13.tmp ma-test13.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --obsolete -o ma-test13.tmp ma-test13.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test13.tmp > ma-test13.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --obsolete -o ma-test13.tmp ma-test13.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test13.tmp > ma-test13.out || exit 1
-tmpfiles="$tmpfiles ma-test13.ok"
cat <<\EOF > ma-test13.ok
# HEADER.
#
${DIFF} ma-test13.ok ma-test13.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test combination of selection and manipulation option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test14.po"
cat <<\EOF > ma-test14.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles ma-test14.tmp ma-test14.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --obsolete --no-fuzzy -o ma-test14.tmp ma-test14.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test14.tmp > ma-test14.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --obsolete --no-fuzzy -o ma-test14.tmp ma-test14.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test14.tmp > ma-test14.out || exit 1
-tmpfiles="$tmpfiles ma-test14.ok"
cat <<\EOF > ma-test14.ok
# HEADER.
#
${DIFF} ma-test14.ok ma-test14.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgattrib on a PO file with contexts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test15.po"
cat <<\EOF > ma-test15.po
msgid ""
msgstr ""
#~ msgstr "Enregistrer sous"
EOF
-tmpfiles="$tmpfiles ma-test15.tmp ma-test15.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --clear-fuzzy -o ma-test15.tmp ma-test15.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test15.tmp > ma-test15.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --clear-fuzzy -o ma-test15.tmp ma-test15.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test15.tmp > ma-test15.out || exit 1
: ${DIFF=diff}
${DIFF} ma-test15.po ma-test15.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgattrib on a PO file with previous msgids.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test16.po"
cat <<\EOF > ma-test16.po
msgid ""
msgstr ""
#~ msgstr "%s: ungültige Option -- %c\n"
EOF
-tmpfiles="$tmpfiles ma-test16.tmp ma-test16.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --fuzzy -o ma-test16.tmp ma-test16.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test16.tmp > ma-test16.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --fuzzy -o ma-test16.tmp ma-test16.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test16.tmp > ma-test16.out || exit 1
-tmpfiles="$tmpfiles ma-test16.ok"
cat <<\EOF > ma-test16.ok
msgid ""
msgstr ""
${DIFF} ma-test16.ok ma-test16.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgattrib option --clear-previous.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test17.po"
cat <<\EOF > ma-test17.po
msgid ""
msgstr ""
#~ msgstr "%s: ungültige Option -- %c\n"
EOF
-tmpfiles="$tmpfiles ma-test17.tmp ma-test17.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --clear-previous -o ma-test17.tmp ma-test17.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test17.tmp > ma-test17.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --clear-previous -o ma-test17.tmp ma-test17.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test17.tmp > ma-test17.out || exit 1
-tmpfiles="$tmpfiles ma-test17.ok"
cat <<\EOF > ma-test17.ok
msgid ""
msgstr ""
${DIFF} ma-test17.ok ma-test17.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --untranslated option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test2.po"
cat <<\EOF > ma-test2.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles ma-test2.tmp ma-test2.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --untranslated -o ma-test2.tmp ma-test2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test2.tmp > ma-test2.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --untranslated -o ma-test2.tmp ma-test2.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test2.tmp > ma-test2.out || exit 1
-tmpfiles="$tmpfiles ma-test2.ok"
cat <<\EOF > ma-test2.ok
# HEADER.
#
${DIFF} ma-test2.ok ma-test2.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --no-fuzzy option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test3.po"
cat <<\EOF > ma-test3.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles ma-test3.tmp ma-test3.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --no-fuzzy -o ma-test3.tmp ma-test3.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test3.tmp > ma-test3.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --no-fuzzy -o ma-test3.tmp ma-test3.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test3.tmp > ma-test3.out || exit 1
-tmpfiles="$tmpfiles ma-test3.ok"
cat <<\EOF > ma-test3.ok
# HEADER.
#
${DIFF} ma-test3.ok ma-test3.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --only-fuzzy option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test4.po"
cat <<\EOF > ma-test4.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles ma-test4.tmp ma-test4.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --only-fuzzy -o ma-test4.tmp ma-test4.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test4.tmp > ma-test4.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --only-fuzzy -o ma-test4.tmp ma-test4.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test4.tmp > ma-test4.out || exit 1
-tmpfiles="$tmpfiles ma-test4.ok"
cat <<\EOF > ma-test4.ok
# HEADER.
#
${DIFF} ma-test4.ok ma-test4.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --no-obsolete option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test5.po"
cat <<\EOF > ma-test5.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles ma-test5.tmp ma-test5.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --no-obsolete -o ma-test5.tmp ma-test5.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test5.tmp > ma-test5.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --no-obsolete -o ma-test5.tmp ma-test5.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test5.tmp > ma-test5.out || exit 1
-tmpfiles="$tmpfiles ma-test5.ok"
cat <<\EOF > ma-test5.ok
# HEADER.
#
${DIFF} ma-test5.ok ma-test5.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --only-obsolete option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test6.po"
cat <<\EOF > ma-test6.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles ma-test6.tmp ma-test6.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --only-obsolete -o ma-test6.tmp ma-test6.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test6.tmp > ma-test6.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --only-obsolete -o ma-test6.tmp ma-test6.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test6.tmp > ma-test6.out || exit 1
-tmpfiles="$tmpfiles ma-test6.ok"
cat <<\EOF > ma-test6.ok
# HEADER.
#
${DIFF} ma-test6.ok ma-test6.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test combination of two selection options.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test7.po"
cat <<\EOF > ma-test7.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles ma-test7.tmp ma-test7.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --translated --only-obsolete -o ma-test7.tmp ma-test7.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test7.tmp > ma-test7.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --translated --only-obsolete -o ma-test7.tmp ma-test7.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test7.tmp > ma-test7.out || exit 1
-tmpfiles="$tmpfiles ma-test7.ok"
cat <<\EOF > ma-test7.ok
# HEADER.
#
${DIFF} ma-test7.ok ma-test7.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --set-fuzzy option. Note that the output routines ignore the fuzzy
# attribute for untranslated messages.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test8.po"
cat <<\EOF > ma-test8.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles ma-test8.tmp ma-test8.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --set-fuzzy -o ma-test8.tmp ma-test8.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test8.tmp > ma-test8.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --set-fuzzy -o ma-test8.tmp ma-test8.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test8.tmp > ma-test8.out || exit 1
-tmpfiles="$tmpfiles ma-test8.ok"
cat <<\EOF > ma-test8.ok
# HEADER.
#
${DIFF} ma-test8.ok ma-test8.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --clear-fuzzy option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-test9.po"
cat <<\EOF > ma-test9.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles ma-test9.tmp ma-test9.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --clear-fuzzy -o ma-test9.tmp ma-test9.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-test9.tmp > ma-test9.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --clear-fuzzy -o ma-test9.tmp ma-test9.po || exit 1
+LC_ALL=C tr -d '\r' < ma-test9.tmp > ma-test9.out || exit 1
-tmpfiles="$tmpfiles ma-test9.ok"
cat <<\EOF > ma-test9.ok
# HEADER.
#
${DIFF} ma-test9.ok ma-test9.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --translated option with Java .properties syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles ma-s-1.properties"
cat <<\EOF > ma-s-1.properties
# HEADER.
#
!They\ warn\ you\ and\ darn\ you=
EOF
-tmpfiles="$tmpfiles ma-s-1.tmp ma-s-1.out"
: ${MSGATTRIB=msgattrib}
-${MSGATTRIB} --translated --properties-input --properties-output -o ma-s-1.tmp ma-s-1.properties
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < ma-s-1.tmp > ma-s-1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGATTRIB} --translated --properties-input --properties-output -o ma-s-1.tmp ma-s-1.properties || exit 1
+LC_ALL=C tr -d '\r' < ma-s-1.tmp > ma-s-1.out || exit 1
-tmpfiles="$tmpfiles ma-s-1.ok"
cat <<\EOF > ma-s-1.ok
# HEADER.
#
${DIFF} ma-s-1.ok ma-s-1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Verify that msgcat doesn't introduce alternative syntax if all translations
# have the same msgstr.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test1.in1 mcat-test1.in2"
cat <<EOF > mcat-test1.in1
msgid ""
msgstr ""
msgstr "eins"
EOF
-tmpfiles="$tmpfiles mcat-test1.tmp mcat-test1.out"
: ${MSGCAT=msgcat}
-${MSGCAT} -o mcat-test1.tmp mcat-test1.in1 mcat-test1.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test1.tmp > mcat-test1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCAT} -o mcat-test1.tmp mcat-test1.in1 mcat-test1.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcat-test1.tmp > mcat-test1.out || exit 1
-tmpfiles="$tmpfiles mcat-test1.ok"
cat << EOF > mcat-test1.ok
msgid ""
msgstr ""
${DIFF} mcat-test1.ok mcat-test1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# translator attention; in other words, an msgstr which is valid in both input
# files is also valid in the result.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test10.in1 mcat-test10.in2"
cat <<\EOF > mcat-test10.in1
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
"Glückwunsch!"
EOF
-tmpfiles="$tmpfiles mcat-test10.tmp mcat-test10.out"
rm -f mcat-test10.tmp
: ${MSGCAT=msgcat}
${MSGCAT} --more-than=0 -o mcat-test10.tmp \
- mcat-test10.in1 mcat-test10.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test10.tmp > mcat-test10.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcat-test10.in1 mcat-test10.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcat-test10.tmp > mcat-test10.out || exit 1
-tmpfiles="$tmpfiles mcat-test10.ok"
cat <<\EOF > mcat-test10.ok
# #-#-#-#-# mcat-test10.in1 (xyz) #-#-#-#-#
# German message file for xyz.
${DIFF} mcat-test10.ok mcat-test10.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Verify that msgcat leaves #: lines in place even if they have a bizarre
# syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test11.in"
cat <<\EOF > mcat-test11.in
#: basctl/source\basicide\basidesh.src#RID_STR_NOMODULE.text
msgid "Simple"
msgstr "immer"
EOF
-tmpfiles="$tmpfiles mcat-test11.tmp mcat-test11.out"
: ${MSGCAT=msgcat}
-${MSGCAT} -o mcat-test11.tmp mcat-test11.in
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test11.tmp > mcat-test11.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCAT} -o mcat-test11.tmp mcat-test11.in || exit 1
+LC_ALL=C tr -d '\r' < mcat-test11.tmp > mcat-test11.out || exit 1
: ${DIFF=diff}
${DIFF} mcat-test11.in mcat-test11.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Verify that msgcat complains when it would need to change msgids.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test12.in1 mcat-test12.in2"
cat <<\EOF > mcat-test12.in1
msgid ""
msgstr ""
msgstr "photocopieur Océ"
EOF
-tmpfiles="$tmpfiles mcat-test12.out"
rm -f mcat-test12.out
: ${MSGCAT=msgcat}
${MSGCAT} -o mcat-test12.out mcat-test12.in1 mcat-test12.in2 2>/dev/null
-test $? = 1 || { rm -fr $tmpfiles; exit 1; }
-
-rm -fr $tmpfiles
+test $? = 1 || { exit 1; }
exit 0
# Test msgcat on PO files with contexts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test13.in1 mcat-test13.in2"
cat <<\EOF > mcat-test13.in1
msgid ""
msgstr ""
#~ msgstr "Enregistrer l'as"
EOF
-tmpfiles="$tmpfiles mcat-test13.tmp mcat-test13.out"
rm -f mcat-test13.tmp
: ${MSGCAT=msgcat}
-${MSGCAT} -o mcat-test13.tmp mcat-test13.in1 mcat-test13.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test13.tmp > mcat-test13.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCAT} -o mcat-test13.tmp mcat-test13.in1 mcat-test13.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcat-test13.tmp > mcat-test13.out || exit 1
-tmpfiles="$tmpfiles mcat-test13.ok"
cat <<\EOF > mcat-test13.ok
msgid ""
msgstr ""
${DIFF} mcat-test13.ok mcat-test13.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Verify that msgcat complains when it would need to change msgctxts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test14.in1 mcat-test14.in2"
cat <<\EOF > mcat-test14.in1
msgid ""
msgstr ""
#~ msgstr "Enregistrer l'as"
EOF
-tmpfiles="$tmpfiles mcat-test14.out"
rm -f mcat-test14.out
: ${MSGCAT=msgcat}
${MSGCAT} -o mcat-test14.out mcat-test14.in1 mcat-test14.in2 2>/dev/null
-test $? = 1 || { rm -fr $tmpfiles; exit 1; }
-
-rm -fr $tmpfiles
+test $? = 1 || { exit 1; }
exit 0
# Test msgcat on a PO file with previous msgids.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test15.in"
cat <<\EOF > mcat-test15.in
msgid ""
msgstr ""
#~ msgstr "%s: ungültige Option -- %c\n"
EOF
-tmpfiles="$tmpfiles mcat-test15.tmp1 mcat-test15.out1"
rm -f mcat-test15.tmp1
: ${MSGCAT=msgcat}
-${MSGCAT} -o mcat-test15.tmp1 mcat-test15.in
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test15.tmp1 > mcat-test15.out1
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCAT} -o mcat-test15.tmp1 mcat-test15.in || exit 1
+LC_ALL=C tr -d '\r' < mcat-test15.tmp1 > mcat-test15.out1 || exit 1
: ${DIFF=diff}
${DIFF} mcat-test15.in mcat-test15.out1
result=$?
-tmpfiles="$tmpfiles mcat-test15.tmp2 mcat-test15.out2"
rm -f mcat-test15.tmp2
: ${MSGCAT=msgcat}
-${MSGCAT} --indent -o mcat-test15.tmp2 mcat-test15.in
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test15.tmp2 > mcat-test15.out2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCAT} --indent -o mcat-test15.tmp2 mcat-test15.in || exit 1
+LC_ALL=C tr -d '\r' < mcat-test15.tmp2 > mcat-test15.out2 || exit 1
-tmpfiles="$tmpfiles mcat-test15.ok"
cat <<\EOF > mcat-test15.ok
msgid ""
msgstr "Report-Msgid-Bugs-To: \n"
${DIFF} mcat-test15.ok mcat-test15.out2
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgcat on a PO files with previous msgids.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test16.in1"
cat <<\EOF > mcat-test16.in1
msgid ""
msgstr ""
msgstr "Argumente fehlen."
EOF
-tmpfiles="$tmpfiles mcat-test16.in2"
cat <<\EOF > mcat-test16.in2
msgid ""
msgstr ""
msgstr "zu wenige Argumente"
EOF
-tmpfiles="$tmpfiles mcat-test16.tmp mcat-test16.out"
rm -f mcat-test16.tmp
: ${MSGCAT=msgcat}
-${MSGCAT} -o mcat-test16.tmp mcat-test16.in1 mcat-test16.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test16.tmp > mcat-test16.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCAT} -o mcat-test16.tmp mcat-test16.in1 mcat-test16.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcat-test16.tmp > mcat-test16.out || exit 1
-tmpfiles="$tmpfiles mcat-test16.ok"
cat <<\EOF > mcat-test16.ok
msgid ""
msgstr ""
${DIFF} mcat-test16.ok mcat-test16.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgcat with --width option. Check that format strings are not broken.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test17.in"
cat <<\EOF > mcat-test17.in
msgid ""
msgstr ""
msgstr "Fehler beim Schreiben eines großen Ergebnisses auf eine zu kleine Platte% s% smit der jederzeitigen Möglichkeit eines Fehlers in jedem Moment und an jeder Stelle"
EOF
-tmpfiles="$tmpfiles mcat-test17.tmp mcat-test17.out"
rm -f mcat-test17.tmp
: ${MSGCAT=msgcat}
-${MSGCAT} -o mcat-test17.tmp --width=80 mcat-test17.in
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test17.tmp > mcat-test17.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCAT} -o mcat-test17.tmp --width=80 mcat-test17.in || exit 1
+LC_ALL=C tr -d '\r' < mcat-test17.tmp > mcat-test17.out || exit 1
-tmpfiles="$tmpfiles mcat-test17.ok"
cat <<\EOF > mcat-test17.ok
msgid ""
msgstr ""
${DIFF} mcat-test17.ok mcat-test17.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgcat: handling of 'range:' flags.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test18.in1 mcat-test18.in2"
cat <<\EOF > mcat-test18.in1
msgid "one day"
msgid_plural "%d days"
msgstr[1] ""
EOF
-tmpfiles="$tmpfiles mcat-test18.tmp mcat-test18.out"
rm -f mcat-test18.tmp
: ${MSGCAT=msgcat}
-${MSGCAT} -o mcat-test18.tmp mcat-test18.in1 mcat-test18.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test18.tmp > mcat-test18.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCAT} -o mcat-test18.tmp mcat-test18.in1 mcat-test18.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcat-test18.tmp > mcat-test18.out || exit 1
-tmpfiles="$tmpfiles mcat-test18.ok"
cat <<\EOF > mcat-test18.ok
#, c-format
msgid "one day"
${DIFF} mcat-test18.ok mcat-test18.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test handling of input files with different charsets.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test2.in1 mcat-test2.in2"
cat <<\EOF > mcat-test2.in1
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
msgstr "Sie können sich als \"%1\" einloggen."
EOF
-tmpfiles="$tmpfiles mcat-test2.tmp mcat-test2.err mcat-test2.out"
rm -f mcat-test2.tmp
: ${MSGCAT=msgcat}
mcat-test2.in1 mcat-test2.in2 >mcat-test2.err 2>&1
result=$?
cat mcat-test2.err | grep -v 'warning: .* encodings' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test2.tmp > mcat-test2.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < mcat-test2.tmp > mcat-test2.out || exit 1
-tmpfiles="$tmpfiles mcat-test2.ok"
cat << \EOF > mcat-test2.ok
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
${DIFF} mcat-test2.ok mcat-test2.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test handling of input files with different charsets.
# 1. ISO-8859-1, 2. UTF-8; plus --use-first
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test3.in1 mcat-test3.in2"
cat <<\EOF > mcat-test3.in1
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
msgstr "Sie können sich als \"%1\" einloggen."
EOF
-tmpfiles="$tmpfiles mcat-test3.tmp mcat-test3.err mcat-test3.out"
rm -f mcat-test3.tmp
: ${MSGCAT=msgcat}
mcat-test3.in1 mcat-test3.in2 >mcat-test3.err 2>&1
result=$?
cat mcat-test3.err | grep -v 'warning: .* encodings' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test3.tmp > mcat-test3.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < mcat-test3.tmp > mcat-test3.out || exit 1
-tmpfiles="$tmpfiles mcat-test3.ok"
cat << \EOF > mcat-test3.ok
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
${DIFF} mcat-test3.ok mcat-test3.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test handling of input files with different charsets:
# 1. UTF-8, 2. ISO-8859-1; plus --use-first
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test4.in1 mcat-test4.in2"
cat <<\EOF > mcat-test4.in1
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
"Glückwunsch!"
EOF
-tmpfiles="$tmpfiles mcat-test4.tmp mcat-test4.err mcat-test4.out"
rm -f mcat-test4.tmp
: ${MSGCAT=msgcat}
mcat-test4.in1 mcat-test4.in2 >mcat-test4.err 2>&1
result=$?
cat mcat-test4.err | grep -v 'warning: .* encodings' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test4.tmp > mcat-test4.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < mcat-test4.tmp > mcat-test4.out || exit 1
-tmpfiles="$tmpfiles mcat-test4.ok"
cat << \EOF > mcat-test4.ok
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
${DIFF} mcat-test4.ok mcat-test4.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test handling of input files with different translations:
# try --use-first
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test5.in1 mcat-test5.in2"
cat <<\EOF > mcat-test5.in1
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
"Herzlichen Glückwunsch!"
EOF
-tmpfiles="$tmpfiles mcat-test5.tmp mcat-test5.out"
rm -f mcat-test5.tmp
: ${MSGCAT=msgcat}
${MSGCAT} --use-first --more-than=0 -o mcat-test5.tmp \
- mcat-test5.in1 mcat-test5.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test5.tmp > mcat-test5.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcat-test5.in1 mcat-test5.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcat-test5.tmp > mcat-test5.out || exit 1
-tmpfiles="$tmpfiles mcat-test5.ok"
cat << \EOF > mcat-test5.ok
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
${DIFF} mcat-test5.ok mcat-test5.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test handling of input files with different translations:
# preserve all variants, add markers
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test6.in1 mcat-test6.in2"
cat <<\EOF > mcat-test6.in1
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
"Herzlichen Glückwunsch!"
EOF
-tmpfiles="$tmpfiles mcat-test6.tmp mcat-test6.out"
rm -f mcat-test6.tmp
: ${MSGCAT=msgcat}
${MSGCAT} --more-than=0 -o mcat-test6.tmp \
- mcat-test6.in1 mcat-test6.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test6.tmp > mcat-test6.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcat-test6.in1 mcat-test6.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcat-test6.tmp > mcat-test6.out || exit 1
-tmpfiles="$tmpfiles mcat-test6.ok"
cat << \EOF > mcat-test6.ok
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
${DIFF} mcat-test6.ok mcat-test6.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Verify 'msgcat --sort-output'
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test7.in1"
cat <<EOF > mcat-test7.in1
#: clients/inst_language.ycp:119
msgid "two"
"1"
EOF
-tmpfiles="$tmpfiles mcat-test7.tmp mcat-test7.out"
rm -f mcat-test7.tmp
: ${MSGCAT=msgcat}
-${MSGCAT} --sort-output -o mcat-test7.tmp mcat-test7.in1
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test7.tmp > mcat-test7.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCAT} --sort-output -o mcat-test7.tmp mcat-test7.in1 || exit 1
+LC_ALL=C tr -d '\r' < mcat-test7.tmp > mcat-test7.out || exit 1
-tmpfiles="$tmpfiles mcat-test7.ok"
cat << EOF > mcat-test7.ok
#: clients/inst_language.ycp:108
msgid "one"
${DIFF} mcat-test7.ok mcat-test7.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Verify msgcat of two files, when the header entries have different comments
# and different contents. The resulting header entry must be marked fuzzy.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test8.in1 mcat-test8.in2"
cat <<\EOF > mcat-test8.in1
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
"Glückwunsch!"
EOF
-tmpfiles="$tmpfiles mcat-test8.tmp mcat-test8.out"
rm -f mcat-test8.tmp
: ${MSGCAT=msgcat}
${MSGCAT} --more-than=0 -o mcat-test8.tmp \
- mcat-test8.in1 mcat-test8.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test8.tmp > mcat-test8.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcat-test8.in1 mcat-test8.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcat-test8.tmp > mcat-test8.out || exit 1
-tmpfiles="$tmpfiles mcat-test8.ok"
cat <<\EOF > mcat-test8.ok
# #-#-#-#-# mcat-test8.in1 (xyz) #-#-#-#-#
# German message file for xyz.
${DIFF} mcat-test8.ok mcat-test8.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Verify msgcat of two files, when the header entries have the same comments
# but different contents. The resulting header entry must be marked fuzzy.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-test9.in1 mcat-test9.in2"
cat <<\EOF > mcat-test9.in1
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
"Glückwunsch!"
EOF
-tmpfiles="$tmpfiles mcat-test9.tmp mcat-test9.out"
rm -f mcat-test9.tmp
: ${MSGCAT=msgcat}
${MSGCAT} --more-than=0 -o mcat-test9.tmp \
- mcat-test9.in1 mcat-test9.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-test9.tmp > mcat-test9.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcat-test9.in1 mcat-test9.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcat-test9.tmp > mcat-test9.out || exit 1
-tmpfiles="$tmpfiles mcat-test9.ok"
cat <<\EOF > mcat-test9.ok
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
${DIFF} mcat-test9.ok mcat-test9.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --use-first option with Java .properties syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-p-1.in1 mcat-p-1.in2"
cat <<\EOF > mcat-p-1.in1
#. Help text (HTML-like) START
#: clients/inst_ask_config.ycp:119
Congratulations\!=Herzlichen Gl\u00fcckwunsch\!
EOF
-tmpfiles="$tmpfiles mcat-p-1.tmp mcat-p-1.out"
rm -f mcat-p-1.tmp
: ${MSGCAT=msgcat}
${MSGCAT} --use-first --more-than=0 --properties-input --properties-output \
- -o mcat-p-1.tmp mcat-p-1.in1 mcat-p-1.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-p-1.tmp > mcat-p-1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -o mcat-p-1.tmp mcat-p-1.in1 mcat-p-1.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcat-p-1.tmp > mcat-p-1.out || exit 1
-tmpfiles="$tmpfiles mcat-p-1.ok"
cat << \EOF > mcat-p-1.ok
#. Help text (HTML-like) START
#: clients/inst_ask_config.ycp:119
${DIFF} mcat-p-1.ok mcat-p-1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test conversion from UTF-8 to BIG5 is a NOP with Java .properties syntax.
# Test that encoding names are case insensitive.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-p-2.properties"
cat <<\EOF > mcat-p-2.properties
#: src/msgcmp.c:155 src/msgmerge.c:273
exactly\ 2\ input\ files\ required=\u6b64\u529f\u80fd\u9700\u8981\u6070\u597d\u6307\u5b9a\u5169\u500b\u8f38\u5165\u6a94
EOF
-tmpfiles="$tmpfiles mcat-p-2.out"
: ${MSGCAT=msgcat}
-${MSGCAT} --properties-input --properties-output -t Big5 -o mcat-p-2.out mcat-p-2.properties
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCAT} --properties-input --properties-output -t Big5 -o mcat-p-2.out mcat-p-2.properties || exit 1
: ${DIFF=diff}
# Redirect stdout, so as not to fill the user's screen with non-ASCII bytes.
${DIFF} mcat-p-2.properties mcat-p-2.out >/dev/null
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test reading in NeXTstep/GNUstep .strings syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcat-s-1.in"
cat <<\EOF > mcat-s-1.in
/* This is an example of a string table file. Everything inside a comment
is completely ignored, even if in "quotes", or \escape characters, etc.
"hoe322070.element";
EOF
-tmpfiles="$tmpfiles mcat-s-1.tmp mcat-s-1.err mcat-s-1.out"
rm -f mcat-s-1.tmp
: ${MSGCAT=msgcat}
LC_MESSAGES=C LC_ALL= \
${MSGCAT} --stringtable-input -o mcat-s-1.tmp mcat-s-1.in >mcat-s-1.err 2>&1
result=$?
cat mcat-s-1.err | grep -v ': internationalized messages'
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcat-s-1.tmp > mcat-s-1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < mcat-s-1.tmp > mcat-s-1.out || exit 1
-tmpfiles="$tmpfiles mcat-s-1.ok"
cat << \EOF > mcat-s-1.ok
# This is an example of a string table file. Everything inside a comment
# is completely ignored, even if in "quotes", or \escape characters, etc.
${DIFF} mcat-s-1.ok mcat-s-1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test a succeeding comparison.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mc-test1.in1 mc-test1.in2"
cat <<EOF > mc-test1.in1
msgid "one" msgstr "first"
msgid "two" msgstr "second"
${MSGCMP} mc-test1.in1 mc-test1.in2 > /dev/null 2>&1
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test a failing comparison.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mc-test2.in1 mc-test2.in2"
cat <<EOF > mc-test2.in1
msgid "one" msgstr "first"
msgid "two" msgstr "second"
msgid "two" msgstr ""
EOF
-tmpfiles="$tmpfiles mc-test2.out"
: ${MSGCMP=msgcmp}
LC_MESSAGES=C LC_ALL= \
${MSGCMP} mc-test2.in1 mc-test2.in2 2>&1 | grep -v '^==' | sed -e 's|[^ ]*\\msgcmp\.exe|msgcmp|' -e 's|^msgcmp\.exe|msgcmp|' | LC_ALL=C tr -d '\r' > mc-test2.out
-tmpfiles="$tmpfiles mc-test2.ok"
cat <<EOF > mc-test2.ok
mc-test2.in2:1: this message is used but not defined...
mc-test2.in1:3: ...but this definition is similar
${DIFF} mc-test2.ok mc-test2.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test a failing comparison with Java .properties syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mc-test3.in1 mc-test3.in2"
cat <<EOF > mc-test3.in1
one=first
two=second
!two=
EOF
-tmpfiles="$tmpfiles mc-test3.out"
: ${MSGCMP=msgcmp}
LC_MESSAGES=C LC_ALL= \
${MSGCMP} --properties-input mc-test3.in1 mc-test3.in2 2>&1 | grep -v '^==' | sed -e 's|[^ ]*\\msgcmp\.exe|msgcmp|' -e 's|^msgcmp\.exe|msgcmp|' | LC_ALL=C tr -d '\r' > mc-test3.out
-tmpfiles="$tmpfiles mc-test3.ok"
cat <<EOF > mc-test3.ok
mc-test3.in2:1: this message is used but not defined...
mc-test3.in1:3: ...but this definition is similar
${DIFF} mc-test3.ok mc-test3.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test comparison with PO files with previous msgids.
# Test --use-fuzzy option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mc-test4.pot"
cat <<\EOF > mc-test4.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
msgstr ""
EOF
-tmpfiles="$tmpfiles mc-test4.po1"
cat <<\EOF > mc-test4.po1
msgid ""
msgstr ""
EOF
# Verify that with fuzzies, all msgids of the POT file are covered.
-tmpfiles="$tmpfiles mc-test4.out11"
: ${MSGCMP=msgcmp}
LC_MESSAGES=C LC_ALL= \
-${MSGCMP} --use-fuzzy mc-test4.po1 mc-test4.pot > mc-test4.out11 2>&1
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCMP} --use-fuzzy mc-test4.po1 mc-test4.pot > mc-test4.out11 2>&1 || exit 1
if grep -v 'warning:' mc-test4.out11 > /dev/null; then
- rm -fr $tmpfiles; exit 1;
+ exit 1;
fi
# Verify that without fuzzies, not all msgids of the POT file are covered.
-tmpfiles="$tmpfiles mc-test4.out12"
: ${MSGCMP=msgcmp}
LC_MESSAGES=C LC_ALL= \
${MSGCMP} mc-test4.po1 mc-test4.pot > mc-test4.out12 2>&1
-test $? = 1 || { rm -fr $tmpfiles; exit 1; }
-grep -v 'warning:' mc-test4.out12 > /dev/null
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $? = 1 || { exit 1; }
+grep -v 'warning:' mc-test4.out12 > /dev/null || exit 1
-tmpfiles="$tmpfiles mc-test4.po2"
cat <<\EOF > mc-test4.po2
msgid ""
msgstr ""
# Verify that without fuzzies, all msgids of the POT file are covered.
# Verify that previous msgids are ignored even when specified on non-fuzzy
# messages.
-tmpfiles="$tmpfiles mc-test4.out2"
: ${MSGCMP=msgcmp}
LC_MESSAGES=C LC_ALL= \
-${MSGCMP} mc-test4.po2 mc-test4.pot > mc-test4.out2 2>&1
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCMP} mc-test4.po2 mc-test4.pot > mc-test4.out2 2>&1 || exit 1
if grep -v 'warning:' mc-test4.out2 > /dev/null; then
- rm -fr $tmpfiles; exit 1;
+ exit 1;
fi
-rm -fr $tmpfiles
-
exit $result
# Test --more-than=0 option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test1.in1 mcomm-test1.in2"
cat <<EOF > mcomm-test1.in1
#: first.c:123
msgid "1"
msgstr "2x"
EOF
-tmpfiles="$tmpfiles mcomm-test1.tmp mcomm-test1.out"
: ${MSGCOMM=msgcomm}
-${MSGCOMM} --more-than=0 -o mcomm-test1.tmp mcomm-test1.in1 mcomm-test1.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test1.tmp > mcomm-test1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCOMM} --more-than=0 -o mcomm-test1.tmp mcomm-test1.in1 mcomm-test1.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test1.tmp > mcomm-test1.out || exit 1
-tmpfiles="$tmpfiles mcomm-test1.ok"
cat << EOF > mcomm-test1.ok
#: first.c:123
msgid "1"
${DIFF} mcomm-test1.ok mcomm-test1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test merge of common entries with --more-than=1 and --omit-header.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test10.in1 mcomm-test10.in2"
cat <<EOF > mcomm-test10.in1
msgid ""
msgstr ""
msgstr ""
EOF
-tmpfiles="$tmpfiles mcomm-test10.tmp mcomm-test10.out"
: ${MSGCOMM=msgcomm}
${MSGCOMM} --more-than=1 --no-location --omit-header -o mcomm-test10.tmp \
- mcomm-test10.in1 mcomm-test10.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test10.tmp > mcomm-test10.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test10.in1 mcomm-test10.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test10.tmp > mcomm-test10.out || exit 1
-tmpfiles="$tmpfiles mcomm-test10.ok"
cat << EOF > mcomm-test10.ok
msgid "1"
msgstr "1x"
${DIFF} mcomm-test10.ok mcomm-test10.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test that --more-than=1 drops entries which occur only once.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test11.in1 mcomm-test11.in2"
cat <<EOF > mcomm-test11.in1
msgid ""
msgstr ""
msgstr ""
EOF
-tmpfiles="$tmpfiles mcomm-test11.tmp mcomm-test11.out"
: ${MSGCOMM=msgcomm}
${MSGCOMM} --more-than=1 --no-location --omit-header -o mcomm-test11.tmp \
- mcomm-test11.in1 mcomm-test11.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test11.tmp > mcomm-test11.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test11.in1 mcomm-test11.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test11.tmp > mcomm-test11.out || exit 1
-tmpfiles="$tmpfiles mcomm-test11.ok"
cat << EOF > mcomm-test11.ok
msgid "1"
msgstr "1x"
${DIFF} mcomm-test11.ok mcomm-test11.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test that --less-than=2 removes entries which occur twice and keeps entries
# which occur only once.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# unique msg in in3
-tmpfiles="$tmpfiles mcomm-test12.in1 mcomm-test12.in2 mcomm-test12.in3"
cat <<EOF > mcomm-test12.in1
msgid ""
msgstr ""
msgstr ""
EOF
-tmpfiles="$tmpfiles mcomm-test12.tmp mcomm-test12.out"
: ${MSGCOMM=msgcomm}
# --unique is shorthand for --less-than=2; do we've to test both
# switches? Are 'for' loops allowed? -ke-
${MSGCOMM} --less-than=2 --no-location --force-po -o mcomm-test12.tmp \
- mcomm-test12.in1 mcomm-test12.in2 mcomm-test12.in3
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test12.tmp > mcomm-test12.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test12.in1 mcomm-test12.in2 mcomm-test12.in3 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test12.tmp > mcomm-test12.out || exit 1
-tmpfiles="$tmpfiles mcomm-test12.ok"
cat << EOF > mcomm-test12.ok
msgid ""
msgstr ""
${DIFF} mcomm-test12.ok mcomm-test12.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test that --less-than=2 removes entries which occur more than twice.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# one msg occurs 3 times (has to go away).
# An unique msg in in3 has to stay.
-tmpfiles="$tmpfiles mcomm-test13.in1 mcomm-test13.in2 mcomm-test13.in3"
cat <<EOF > mcomm-test13.in1
msgid ""
msgstr ""
msgstr ""
EOF
-tmpfiles="$tmpfiles mcomm-test13.tmp mcomm-test13.out"
: ${MSGCOMM=msgcomm}
# --unique is shorthand for --less-than=2; do we've to test both
# switches? Are 'for' loops allowed? -ke-
${MSGCOMM} --less-than=2 --no-location --force-po -o mcomm-test13.tmp \
- mcomm-test13.in1 mcomm-test13.in2 mcomm-test13.in3
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test13.tmp > mcomm-test13.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test13.in1 mcomm-test13.in2 mcomm-test13.in3 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test13.tmp > mcomm-test13.out || exit 1
-tmpfiles="$tmpfiles mcomm-test13.ok"
cat << EOF > mcomm-test13.ok
msgid ""
msgstr ""
${DIFF} mcomm-test13.ok mcomm-test13.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --force-po option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# no unique msg in input files.
# without --force-po don't create any PO file; cf. msgcomm-15
-tmpfiles="$tmpfiles mcomm-test14.in1 mcomm-test14.in2 mcomm-test14.in3"
cat <<EOF > mcomm-test14.in1
msgid ""
msgstr ""
msgstr ""
EOF
-tmpfiles="$tmpfiles mcomm-test14.tmp mcomm-test14.out"
: ${MSGCOMM=msgcomm}
# --unique is shorthand for --less-than=2; do we've to test both
# switches? Are 'for' loops allowed? -ke-
${MSGCOMM} --less-than=2 --no-location --force-po -o mcomm-test14.tmp \
- mcomm-test14.in1 mcomm-test14.in2 mcomm-test14.in3
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test14.tmp > mcomm-test14.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test14.in1 mcomm-test14.in2 mcomm-test14.in3 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test14.tmp > mcomm-test14.out || exit 1
-tmpfiles="$tmpfiles mcomm-test14.ok"
cat << EOF > mcomm-test14.ok
msgid ""
msgstr ""
${DIFF} mcomm-test14.ok mcomm-test14.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test that without --force-po option, a PO file without translations is
# not created.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# no unique msg in input files.
# with --force-po create an empty PO file; cf. msgcomm-14
-tmpfiles="$tmpfiles mcomm-test15.in1 mcomm-test15.in2 mcomm-test15.in3"
cat <<EOF > mcomm-test15.in1
msgid ""
msgstr ""
msgstr ""
EOF
-tmpfiles="$tmpfiles mcomm-test15.out"
rm -f mcomm-test15.out
: ${MSGCOMM=msgcomm}
# --unique is shorthand for --less-than=2; do we've to test both
# switches? Are 'for' loops allowed? -ke-
${MSGCOMM} --less-than=2 --no-location -o mcomm-test15.out \
- mcomm-test15.in1 mcomm-test15.in2 mcomm-test15.in3
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test15.in1 mcomm-test15.in2 mcomm-test15.in3 || exit 1
# we've no unique msg; thus no PO should be created.
if test -f mcomm-test15.out; then
result=0
fi
-rm -fr $tmpfiles
-
exit $result
# Test handling of input files with different charsets.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test16.in1 mcomm-test16.in2"
cat <<\EOF > mcomm-test16.in1
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
msgstr "Sie können sich als \"%1\" einloggen."
EOF
-tmpfiles="$tmpfiles mcomm-test16.tmp mcomm-test16.err mcomm-test16.out"
rm -f mcomm-test16.tmp
: ${MSGCOMM=msgcomm}
mcomm-test16.in1 mcomm-test16.in2 >mcomm-test16.err 2>&1
result=$?
cat mcomm-test16.err | grep -v 'warning: .* encodings' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test16.tmp > mcomm-test16.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < mcomm-test16.tmp > mcomm-test16.out || exit 1
-tmpfiles="$tmpfiles mcomm-test16.ok"
cat << \EOF > mcomm-test16.ok
# German message file for xyz.
# Copyright (C) 1999, 2000, 2001 xyz.
${DIFF} mcomm-test16.ok mcomm-test16.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# entries only (entries occurring less than 2 times). But don't drop the
# header entry; otherwise msgcomm will fail for multibyte strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test17.in1 mcomm-test17.in2 mcomm-test17.in3"
cat <<EOF > mcomm-test17.in1
msgid ""
msgstr ""
msgstr "fünf"
EOF
-tmpfiles="$tmpfiles mcomm-test17.tmp mcomm-test17.out"
: ${MSGCOMM=msgcomm}
${MSGCOMM} -u \
-o mcomm-test17.tmp \
- mcomm-test17.in1 mcomm-test17.in2 mcomm-test17.in3
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test17.tmp > mcomm-test17.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test17.in1 mcomm-test17.in2 mcomm-test17.in3 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test17.tmp > mcomm-test17.out || exit 1
-tmpfiles="$tmpfiles mcomm-test17.ok"
cat << \EOF > mcomm-test17.ok
msgid ""
msgstr ""
${DIFF} mcomm-test17.ok mcomm-test17.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --more-than=0; identical message are wanted once only.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test18.in1 mcomm-test18.in2"
cat <<EOF > mcomm-test18.in1
# Sure.
#: first.c:123
msgstr "1x"
EOF
-tmpfiles="$tmpfiles mcomm-test18.tmp mcomm-test18.out"
: ${MSGCOMM=msgcomm}
-${MSGCOMM} --more-than=0 -o mcomm-test18.tmp mcomm-test18.in1 mcomm-test18.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test18.tmp > mcomm-test18.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCOMM} --more-than=0 -o mcomm-test18.tmp mcomm-test18.in1 mcomm-test18.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test18.tmp > mcomm-test18.out || exit 1
-tmpfiles="$tmpfiles mcomm-test18.ok"
cat << EOF > mcomm-test18.ok
# Sure.
#: first.c:123 hunt.c:759
${DIFF} mcomm-test18.ok mcomm-test18.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --more-than=0; identical message are wanted once only.
# If the first occurrence is fuzzy, keep the fuzzy mark.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test19.in1 mcomm-test19.in2"
cat <<EOF > mcomm-test19.in1
# Not sure.
#: first.c:123
msgstr "1x"
EOF
-tmpfiles="$tmpfiles mcomm-test19.tmp mcomm-test19.out"
: ${MSGCOMM=msgcomm}
-${MSGCOMM} --more-than=0 -o mcomm-test19.tmp mcomm-test19.in1 mcomm-test19.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test19.tmp > mcomm-test19.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCOMM} --more-than=0 -o mcomm-test19.tmp mcomm-test19.in1 mcomm-test19.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test19.tmp > mcomm-test19.out || exit 1
-tmpfiles="$tmpfiles mcomm-test19.ok"
cat << EOF > mcomm-test19.ok
# Not sure.
#: first.c:123 hunt.c:759
${DIFF} mcomm-test19.ok mcomm-test19.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --no-location option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test2.in1 mcomm-test2.in2"
cat <<EOF > mcomm-test2.in1
#: first.c:123
msgid "1"
msgstr "2x"
EOF
-tmpfiles="$tmpfiles mcomm-test2.tmp mcomm-test2.out"
: ${MSGCOMM=msgcomm}
${MSGCOMM} --more-than=0 --no-location -o mcomm-test2.tmp \
- mcomm-test2.in1 mcomm-test2.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test2.tmp > mcomm-test2.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test2.in1 mcomm-test2.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test2.tmp > mcomm-test2.out || exit 1
-tmpfiles="$tmpfiles mcomm-test2.ok"
cat << EOF > mcomm-test2.ok
msgid "1"
msgstr "1x"
${DIFF} mcomm-test2.ok mcomm-test2.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --more-than=0; identical message are wanted once only.
# If the first occurrence is not fuzzy, don't make the result fuzzy.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test20.in1 mcomm-test20.in2"
cat <<EOF > mcomm-test20.in1
# Sure.
#: first.c:123
msgstr "1x"
EOF
-tmpfiles="$tmpfiles mcomm-test20.tmp mcomm-test20.out"
: ${MSGCOMM=msgcomm}
${MSGCOMM} --more-than=0 -o mcomm-test20.tmp \
- mcomm-test20.in1 mcomm-test20.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test20.tmp > mcomm-test20.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test20.in1 mcomm-test20.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test20.tmp > mcomm-test20.out || exit 1
-tmpfiles="$tmpfiles mcomm-test20.ok"
cat << EOF > mcomm-test20.ok
# Sure.
#: first.c:123 hunt.c:759
${DIFF} mcomm-test20.ok mcomm-test20.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --more-than=0; identical message are wanted once only.
# If both occurrences are fuzzy, keep the fuzzy mark.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test21.in1 mcomm-test21.in2"
cat <<EOF > mcomm-test21.in1
# Not sure.
#: first.c:123
msgstr "1x"
EOF
-tmpfiles="$tmpfiles mcomm-test21.tmp mcomm-test21.out"
: ${MSGCOMM=msgcomm}
-${MSGCOMM} --more-than=0 -o mcomm-test21.tmp mcomm-test21.in1 mcomm-test21.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test21.tmp > mcomm-test21.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCOMM} --more-than=0 -o mcomm-test21.tmp mcomm-test21.in1 mcomm-test21.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test21.tmp > mcomm-test21.out || exit 1
-tmpfiles="$tmpfiles mcomm-test21.ok"
cat << EOF > mcomm-test21.ok
# Not sure.
#: first.c:123 hunt.c:759
${DIFF} mcomm-test21.ok mcomm-test21.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Verify that the header entry is kept, otherwise the encoding is unknown.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test22.in1 mcomm-test22.in2"
cat <<\EOF > mcomm-test22.in1
# German translations for GNU gettext package.
# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
msgstr "virtueller Speicher erschöpft"
EOF
-tmpfiles="$tmpfiles mcomm-test22.tmp mcomm-test22.out"
rm -f mcomm-test22.tmp
: ${MSGCOMM=msgcomm}
${MSGCOMM} --less-than=2 -o mcomm-test22.tmp \
- mcomm-test22.in1 mcomm-test22.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test22.tmp > mcomm-test22.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test22.in1 mcomm-test22.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test22.tmp > mcomm-test22.out || exit 1
-tmpfiles="$tmpfiles mcomm-test22.ok"
cat << \EOF > mcomm-test22.ok
# German translations for GNU gettext package.
# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
${DIFF} mcomm-test22.ok mcomm-test22.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# "msgcomm INPUT INPUT" is equivalent to "msguniq INPUT"
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-23.in1 mcomm-23.in2"
cp "$abs_srcdir"/msguniq-a.in mcomm-23.in1
cp "$abs_srcdir"/msguniq-a.in mcomm-23.in2
-tmpfiles="$tmpfiles mcomm-23.tmp mcomm-23.out"
: ${MSGCOMM=msgcomm}
-${MSGCOMM} -w 1000 -o mcomm-23.tmp mcomm-23.in1 mcomm-23.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-23.tmp > mcomm-23.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCOMM} -w 1000 -o mcomm-23.tmp mcomm-23.in1 mcomm-23.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-23.tmp > mcomm-23.out || exit 1
: ${DIFF=diff}
${DIFF} "$abs_srcdir"/msguniq-a.out mcomm-23.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --more-than=0 option with Java .properties syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test24.in1 mcomm-test24.in2"
cat <<EOF > mcomm-test24.in1
#: first.c:123
1=1x
2=2x
EOF
-tmpfiles="$tmpfiles mcomm-test24.tmp mcomm-test24.out"
: ${MSGCOMM=msgcomm}
-${MSGCOMM} --more-than=0 --properties-input --properties-output -o mcomm-test24.tmp mcomm-test24.in1 mcomm-test24.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test24.tmp > mcomm-test24.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCOMM} --more-than=0 --properties-input --properties-output -o mcomm-test24.tmp mcomm-test24.in1 mcomm-test24.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test24.tmp > mcomm-test24.out || exit 1
-tmpfiles="$tmpfiles mcomm-test24.ok"
cat << EOF > mcomm-test24.ok
#: first.c:123
1=1x
${DIFF} mcomm-test24.ok mcomm-test24.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgcomm on PO files with contexts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test25.in1 mcomm-test25.in2"
cat <<\EOF > mcomm-test25.in1
msgid ""
msgstr ""
#~ msgstr "Enregistrer l'as"
EOF
-tmpfiles="$tmpfiles mcomm-test25.tmp mcomm-test25.out"
: ${MSGCOMM=msgcomm}
-${MSGCOMM} --more-than=0 -o mcomm-test25.tmp mcomm-test25.in1 mcomm-test25.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test25.tmp > mcomm-test25.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCOMM} --more-than=0 -o mcomm-test25.tmp mcomm-test25.in1 mcomm-test25.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test25.tmp > mcomm-test25.out || exit 1
-tmpfiles="$tmpfiles mcomm-test25.ok"
cat <<\EOF > mcomm-test25.ok
msgid ""
msgstr ""
${DIFF} mcomm-test25.ok mcomm-test25.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgcomm on PO files with previous msgids.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test26.in1"
cat <<\EOF > mcomm-test26.in1
msgid ""
msgstr ""
msgstr "%s: ungültige Option -- %c\n"
EOF
-tmpfiles="$tmpfiles mcomm-test26.in2"
cat <<\EOF > mcomm-test26.in2
msgid ""
msgstr ""
msgstr "%s: ungültige Optionen -- %c\n"
EOF
-tmpfiles="$tmpfiles mcomm-test26.tmp mcomm-test26.out"
: ${MSGCOMM=msgcomm}
-${MSGCOMM} -o mcomm-test26.tmp mcomm-test26.in1 mcomm-test26.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test26.tmp > mcomm-test26.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCOMM} -o mcomm-test26.tmp mcomm-test26.in1 mcomm-test26.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test26.tmp > mcomm-test26.out || exit 1
-tmpfiles="$tmpfiles mcomm-test26.ok"
cat <<\EOF > mcomm-test26.ok
msgid ""
msgstr ""
${DIFF} mcomm-test26.ok mcomm-test26.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test handling of format and 'range:' flag.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test27.in1 mcomm-test27.in2"
cat <<EOF > mcomm-test27.in1
msgid "one day"
msgid_plural "%d days"
msgstr[1] ""
EOF
-tmpfiles="$tmpfiles mcomm-test27.tmp mcomm-test27.out"
: ${MSGCOMM=msgcomm}
-${MSGCOMM} -o mcomm-test27.tmp mcomm-test27.in1 mcomm-test27.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test27.tmp > mcomm-test27.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCOMM} -o mcomm-test27.tmp mcomm-test27.in1 mcomm-test27.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test27.tmp > mcomm-test27.out || exit 1
-tmpfiles="$tmpfiles mcomm-test27.ok"
cat << EOF > mcomm-test27.ok
#, c-format
msgid "one day"
${DIFF} mcomm-test27.ok mcomm-test27.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --omit-header option when there is no header.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test3.in1 mcomm-test3.in2"
cat <<EOF > mcomm-test3.in1
#: first.c:123
msgid "1"
msgstr "2x"
EOF
-tmpfiles="$tmpfiles mcomm-test3.tmp mcomm-test3.out"
: ${MSGCOMM=msgcomm}
${MSGCOMM} --more-than=0 --omit-header -o mcomm-test3.tmp \
- mcomm-test3.in1 mcomm-test3.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test3.tmp > mcomm-test3.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test3.in1 mcomm-test3.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test3.tmp > mcomm-test3.out || exit 1
-tmpfiles="$tmpfiles mcomm-test3.ok"
cat << EOF > mcomm-test3.ok
#: first.c:123
msgid "1"
${DIFF} mcomm-test3.ok mcomm-test3.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test what happens with the header entry.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test4.in1 mcomm-test4.in2"
cat <<EOF > mcomm-test4.in1
msgid ""
msgstr ""
msgstr "2x"
EOF
-tmpfiles="$tmpfiles mcomm-test4.tmp mcomm-test4.out"
: ${MSGCOMM=msgcomm}
${MSGCOMM} --more-than=0 -o mcomm-test4.tmp \
- mcomm-test4.in1 mcomm-test4.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test4.tmp > mcomm-test4.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test4.in1 mcomm-test4.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test4.tmp > mcomm-test4.out || exit 1
-tmpfiles="$tmpfiles mcomm-test4.ok"
cat << EOF > mcomm-test4.ok
msgid ""
msgstr ""
${DIFF} mcomm-test4.ok mcomm-test4.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --omit-header option when there is a header.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test5.in1 mcomm-test5.in2"
cat <<EOF > mcomm-test5.in1
msgid ""
msgstr ""
msgstr "2x"
EOF
-tmpfiles="$tmpfiles mcomm-test5.tmp mcomm-test5.out"
: ${MSGCOMM=msgcomm}
${MSGCOMM} --more-than=0 --omit-header -o mcomm-test5.tmp \
- mcomm-test5.in1 mcomm-test5.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test5.tmp > mcomm-test5.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test5.in1 mcomm-test5.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test5.tmp > mcomm-test5.out || exit 1
-tmpfiles="$tmpfiles mcomm-test5.ok"
cat << EOF > mcomm-test5.ok
#: first.c:123
msgid "1"
${DIFF} mcomm-test5.ok mcomm-test5.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --no-location option when there is a header.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test6.in1 mcomm-test6.in2"
cat <<EOF > mcomm-test6.in1
msgid ""
msgstr ""
msgstr "2x"
EOF
-tmpfiles="$tmpfiles mcomm-test6.tmp mcomm-test6.out"
: ${MSGCOMM=msgcomm}
${MSGCOMM} --more-than=0 --no-location -o mcomm-test6.tmp \
- mcomm-test6.in1 mcomm-test6.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test6.tmp > mcomm-test6.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test6.in1 mcomm-test6.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test6.tmp > mcomm-test6.out || exit 1
-tmpfiles="$tmpfiles mcomm-test6.ok"
cat << EOF > mcomm-test6.ok
msgid ""
msgstr ""
${DIFF} mcomm-test6.ok mcomm-test6.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --no-location and --omit-header options together.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test7.in1 mcomm-test7.in2"
cat <<EOF > mcomm-test7.in1
msgid ""
msgstr ""
msgstr "2x"
EOF
-tmpfiles="$tmpfiles mcomm-test7.tmp mcomm-test7.out"
: ${MSGCOMM=msgcomm}
${MSGCOMM} --more-than=0 --no-location --omit-header -o mcomm-test7.tmp \
- mcomm-test7.in1 mcomm-test7.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test7.tmp > mcomm-test7.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test7.in1 mcomm-test7.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test7.tmp > mcomm-test7.out || exit 1
-tmpfiles="$tmpfiles mcomm-test7.ok"
cat << EOF > mcomm-test7.ok
msgid "1"
msgstr "1x"
${DIFF} mcomm-test7.ok mcomm-test7.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test merge of common entries with --more-than=1.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test8.in1 mcomm-test8.in2"
cat <<EOF > mcomm-test8.in1
msgid ""
msgstr ""
msgstr ""
EOF
-tmpfiles="$tmpfiles mcomm-test8.tmp mcomm-test8.out"
: ${MSGCOMM=msgcomm}
${MSGCOMM} --more-than=1 -o mcomm-test8.tmp \
- mcomm-test8.in1 mcomm-test8.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test8.tmp > mcomm-test8.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test8.in1 mcomm-test8.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test8.tmp > mcomm-test8.out || exit 1
-tmpfiles="$tmpfiles mcomm-test8.ok"
cat << EOF > mcomm-test8.ok
msgid ""
msgstr ""
${DIFF} mcomm-test8.ok mcomm-test8.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test merge of common entries with --more-than=1 and --no-location.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mcomm-test9.in1 mcomm-test9.in2"
cat <<EOF > mcomm-test9.in1
msgid ""
msgstr ""
msgstr ""
EOF
-tmpfiles="$tmpfiles mcomm-test9.tmp mcomm-test9.out"
: ${MSGCOMM=msgcomm}
${MSGCOMM} --more-than=1 --no-location -o mcomm-test9.tmp \
- mcomm-test9.in1 mcomm-test9.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mcomm-test9.tmp > mcomm-test9.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mcomm-test9.in1 mcomm-test9.in2 || exit 1
+LC_ALL=C tr -d '\r' < mcomm-test9.tmp > mcomm-test9.out || exit 1
-tmpfiles="$tmpfiles mcomm-test9.ok"
cat << EOF > mcomm-test9.ok
msgid ""
msgstr ""
${DIFF} mcomm-test9.ok mcomm-test9.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test conversion from BIG5 to UTF-8.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mco-test1.po"
cat <<\EOF > mco-test1.po
# Chinese translation for GNU gettext messages.
#
msgstr "¦¹¥\¯à»Ýn«ê¦n«ü©w¨âÓ¿é¤JÀÉ"
EOF
-tmpfiles="$tmpfiles mco-test1.out"
: ${MSGCONV=msgconv}
-${MSGCONV} --to-code=UTF-8 -o mco-test1.out mco-test1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCONV} --to-code=UTF-8 -o mco-test1.out mco-test1.po || exit 1
-tmpfiles="$tmpfiles mco-test1.ok"
cat <<\EOF > mco-test1.ok
# Chinese translation for GNU gettext messages.
#
${DIFF} mco-test1.ok mco-test1.out >/dev/null
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test conversion from UTF-8 to BIG5.
# Test that encoding names are case insensitive.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mco-test2.po"
cat <<\EOF > mco-test2.po
# Chinese translation for GNU gettext messages.
#
msgstr "此功能需要恰好指定兩個輸入檔"
EOF
-tmpfiles="$tmpfiles mco-test2.out"
: ${MSGCONV=msgconv}
-${MSGCONV} -t Big5 -o mco-test2.out mco-test2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCONV} -t Big5 -o mco-test2.out mco-test2.po || exit 1
-tmpfiles="$tmpfiles mco-test2.ok"
cat <<\EOF > mco-test2.ok
# Chinese translation for GNU gettext messages.
#
${DIFF} mco-test2.ok mco-test2.out >/dev/null
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test failing conversion from ISO-8859-15 to ISO-8859-1.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mco-test3.po"
cat <<\EOF > mco-test3.po
msgid ""
msgstr ""
msgstr "¼uvre"
EOF
-tmpfiles="$tmpfiles mco-test3.out"
: ${MSGCONV=msgconv}
${MSGCONV} -t ISO-8859-1 mco-test3.po -o mco-test3.out 2>/dev/null
test $? = 1
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test conversion from UTF-8 to BIG5 is a NOP with Java .properties syntax.
# Test that encoding names are case insensitive.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mco-test4.properties"
cat <<\EOF > mco-test4.properties
#: src/msgcmp.c:155 src/msgmerge.c:273
exactly\ 2\ input\ files\ required=\u6b64\u529f\u80fd\u9700\u8981\u6070\u597d\u6307\u5b9a\u5169\u500b\u8f38\u5165\u6a94
EOF
-tmpfiles="$tmpfiles mco-test4.out"
: ${MSGCONV=msgconv}
-${MSGCONV} --properties-input --properties-output -t Big5 -o mco-test4.out mco-test4.properties
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCONV} --properties-input --properties-output -t Big5 -o mco-test4.out mco-test4.properties || exit 1
: ${DIFF=diff}
# Redirect stdout, so as not to fill the user's screen with non-ASCII bytes.
${DIFF} mco-test4.properties mco-test4.out >/dev/null
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgconv on a PO file with contexts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mco-test5.po"
cat <<\EOF > mco-test5.po
msgid ""
msgstr ""
#~ msgstr "Enregistrer sous"
EOF
-tmpfiles="$tmpfiles mco-test5.tmp mco-test5.out"
: ${MSGCONV=msgconv}
-${MSGCONV} --to-code=UTF-8 -o mco-test5.tmp mco-test5.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mco-test5.tmp > mco-test5.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCONV} --to-code=UTF-8 -o mco-test5.tmp mco-test5.po || exit 1
+LC_ALL=C tr -d '\r' < mco-test5.tmp > mco-test5.out || exit 1
-tmpfiles="$tmpfiles mco-test5.ok"
cat <<\EOF > mco-test5.ok
msgid ""
msgstr ""
${DIFF} mco-test5.ok mco-test5.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgconv on a PO file with previous msgids.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mco-test6.po"
cat <<\EOF > mco-test6.po
msgid ""
msgstr ""
msgstr "Volle 360 Grad"
EOF
-tmpfiles="$tmpfiles mco-test6.tmp mco-test6.out"
: ${MSGCONV=msgconv}
-${MSGCONV} --to-code=ISO-8859-1 -o mco-test6.tmp mco-test6.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mco-test6.tmp > mco-test6.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCONV} --to-code=ISO-8859-1 -o mco-test6.tmp mco-test6.po || exit 1
+LC_ALL=C tr -d '\r' < mco-test6.tmp > mco-test6.out || exit 1
-tmpfiles="$tmpfiles mco-test6.ok"
cat <<\EOF > mco-test6.ok
msgid ""
msgstr ""
${DIFF} mco-test6.ok mco-test6.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test general operation.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles men-test1.po"
cat <<EOF > men-test1.po
# HEADER.
#
msgstr[1] ""
EOF
-tmpfiles="$tmpfiles men-test1.tmp men-test1.out"
: ${MSGEN=msgen}
-${MSGEN} -o men-test1.tmp men-test1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < men-test1.tmp > men-test1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGEN} -o men-test1.tmp men-test1.po || exit 1
+LC_ALL=C tr -d '\r' < men-test1.tmp > men-test1.out || exit 1
-tmpfiles="$tmpfiles men-test1.ok"
cat <<EOF > men-test1.ok
# HEADER.
#
${DIFF} men-test1.ok men-test1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test general operation with Java .properties syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles men-test2.properties"
cat <<\EOF > men-test2.properties
!height\ must\ be\ positive=
width\ must\ be\ positive=
EOF
-tmpfiles="$tmpfiles men-test2.tmp men-test2.out"
: ${MSGEN=msgen}
-${MSGEN} --properties-input --properties-output -o men-test2.tmp men-test2.properties
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < men-test2.tmp > men-test2.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGEN} --properties-input --properties-output -o men-test2.tmp men-test2.properties || exit 1
+LC_ALL=C tr -d '\r' < men-test2.tmp > men-test2.out || exit 1
-tmpfiles="$tmpfiles men-test2.ok"
cat <<\EOF > men-test2.ok
height\ must\ be\ positive=height must be positive
${DIFF} men-test2.ok men-test2.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgen on a POT file with contexts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles men-test3.pot"
cat <<\EOF > men-test3.pot
msgid ""
msgstr ""
msgstr ""
EOF
-tmpfiles="$tmpfiles men-test3.tmp men-test3.out"
: ${MSGEN=msgen}
-${MSGEN} -o men-test3.tmp men-test3.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < men-test3.tmp > men-test3.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGEN} -o men-test3.tmp men-test3.pot || exit 1
+LC_ALL=C tr -d '\r' < men-test3.tmp > men-test3.out || exit 1
-tmpfiles="$tmpfiles men-test3.ok"
cat <<\EOF > men-test3.ok
msgid ""
msgstr ""
${DIFF} men-test3.ok men-test3.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of an external command.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mex-test1.po"
cat <<\EOF > mex-test1.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles mex-test1.sh"
cat <<\EOF > mex-test1.sh
#! /bin/sh
echo "========================= $MSGEXEC_LOCATION =========================" | LC_ALL=C tr -d '\r'
EOF
chmod a+x mex-test1.sh
-tmpfiles="$tmpfiles mex-test1.out mex-test1.err"
: ${MSGEXEC=msgexec}
LC_ALL=C \
${MSGEXEC} -i mex-test1.po ./mex-test1.sh > mex-test1.out 2> mex-test1.err
result=$?
cat mex-test1.err | grep -v 'warning: Locale charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
-tmpfiles="$tmpfiles mex-test1.ok"
cat <<\EOF > mex-test1.ok
========================= mex-test1.po:4 =========================
${DIFF} mex-test1.ok mex-test1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test the builtin command "0".
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# Find a 'tr' program that supports NUL bytes in the input.
# Solaris /usr/bin/tr does not.
if test -f /usr/xpg6/bin/tr; then
fi
fi
-tmpfiles="$tmpfiles mex-test2.po"
cat <<\EOF > mex-test2.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles mex-test2.tmp mex-test2.out mex-test2.err"
: ${MSGEXEC=msgexec}
LC_ALL=C \
${MSGEXEC} -i mex-test2.po 0 > mex-test2.tmp 2> mex-test2.err
result=$?
cat mex-test2.err | grep -v 'warning: Locale charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C $TR -d '\r' < mex-test2.tmp > mex-test2.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C $TR -d '\r' < mex-test2.tmp > mex-test2.out || exit 1
: ${CMP=cmp}
${CMP} "$abs_srcdir"/mex-test2.ok mex-test2.out >/dev/null 2>/dev/null
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of an external command with Java .properties syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mex-test3.properties"
cat <<\EOF > mex-test3.properties
# HEADER.
#
!They\ warn\ you\ and\ darn\ you=
EOF
-tmpfiles="$tmpfiles mex-test3.sh"
cat <<\EOF > mex-test3.sh
#! /bin/sh
echo "========================= $MSGEXEC_LOCATION =========================" | LC_ALL=C tr -d '\r'
EOF
chmod a+x mex-test3.sh
-tmpfiles="$tmpfiles mex-test3.out"
: ${MSGEXEC=msgexec}
-${MSGEXEC} --properties-input -i mex-test3.properties ./mex-test3.sh > mex-test3.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGEXEC} --properties-input -i mex-test3.properties ./mex-test3.sh > mex-test3.out || exit 1
-tmpfiles="$tmpfiles mex-test3.ok"
cat <<\EOF > mex-test3.ok
========================= mex-test3.properties:3 =========================
${DIFF} mex-test3.ok mex-test3.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# in the GetACP() encoding). This has been reported at
# <http://cygwin.com/ml/cygwin/2009-08/msg00430.html>.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mex-test4.po"
cat <<\EOF > mex-test4.po
msgid ""
msgstr ""
#~ msgstr "Enregistrer sous"
EOF
-tmpfiles="$tmpfiles mex-test4.sh"
cat <<\EOF > mex-test4.sh
#! /bin/sh
echo "========================= $MSGEXEC_LOCATION =========================" | LC_ALL=C tr -d '\r'
EOF
chmod a+x mex-test4.sh
-tmpfiles="$tmpfiles mex-test4.out mex-test4.err"
: ${MSGEXEC=msgexec}
LC_ALL=C \
${MSGEXEC} -i mex-test4.po ./mex-test4.sh > mex-test4.out 2> mex-test4.err
result=$?
cat mex-test4.err | grep -v 'warning: Locale charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
-tmpfiles="$tmpfiles mex-test4.ok"
cat <<\EOF > mex-test4.ok
========================= mex-test4.po:2 =========================
${DIFF} mex-test4.ok mex-test4.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test general filter execution.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
# spaces.
echo abc | fold -b -s -w 20 >/dev/null 2>&1 || {
echo "Skipping test: fold program not POSIX compliant"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
# Some fold programs (like NetBSD 5.0) remove trailing spaces when wrapping.
echo ab cd | fold -b -s -w 3 | grep ' ' >/dev/null || {
echo "Skipping test: fold program trims trailing spaces"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
# Some fold programs (like HP-UX) insert a newline at the end, if the last
foldoutputcount=`echo "$foldoutputcount" | sed -e 's/[ ]//g'`
test "$foldoutputcount" = 3 || {
echo "Skipping test: fold program inserts extra newline"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles mfi-test1.po"
cat <<\EOF > mfi-test1.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles mfi-test1.out mfi-test1.err"
: ${MSGFILTER=msgfilter}
LC_ALL=C \
${MSGFILTER} -i mfi-test1.po -o mfi-test1.out fold -b -s -w 20 >mfi-test1.err 2>&1
result=$?
cat mfi-test1.err | grep -v 'warning: Locale charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
-tmpfiles="$tmpfiles mfi-test1.ok"
cat <<\EOF > mfi-test1.ok
# HEADER.
#
${DIFF} mfi-test1.ok mfi-test1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test sed execution.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
sedoutput=`echo $ac_n "abc$ac_c" | sed -e s/x/x/`
test -n "$sedoutput" || {
echo "Skipping test: sed program is broken"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
# Some sed programs (IRIX, OSF/1 etc.) add a newline to the last line if it
sedoutputcount=`echo "$sedoutputcount" | sed -e 's/[ ]//g'`
test "$sedoutputcount" = 3 || {
echo "Skipping test: sed program inserts extra newline"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles mfi-test2.po"
cat <<\EOF > mfi-test2.po
# HEADER.
#
#~ msgstr "das einen verheirateten Mann liebt"
EOF
-tmpfiles="$tmpfiles mfi-test2.out mfi-test2.err"
: ${MSGFILTER=msgfilter}
sedexpr1='1{
s/^/\[\[/
${MSGFILTER} -i mfi-test2.po -o mfi-test2.out sed -e "$sedexpr1" -e "$sedexpr2" >mfi-test2.err 2>&1
result=$?
cat mfi-test2.err | grep -v 'warning: Locale charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
-tmpfiles="$tmpfiles mfi-test2.ok"
cat <<\EOF > mfi-test2.ok
# HEADER.
#
${DIFF} mfi-test2.ok mfi-test2.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test general filter execution with Java .properties syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
# spaces.
echo abc | fold -b -s -w 20 >/dev/null 2>&1 || {
echo "Skipping test: fold program not POSIX compliant"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
# Some fold programs (like NetBSD 5.0) remove trailing spaces when wrapping.
echo ab cd | fold -b -s -w 3 | grep ' ' >/dev/null || {
echo "Skipping test: fold program trims trailing spaces"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
# Some fold programs (like HP-UX) insert a newline at the end, if the last
foldoutputcount=`echo "$foldoutputcount" | sed -e 's/[ ]//g'`
test "$foldoutputcount" = 3 || {
echo "Skipping test: fold program inserts extra newline"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles mfi-test3.properties"
cat <<\EOF > mfi-test3.properties
# HEADER.
#
!They\ warn\ you\ and\ darn\ you=
EOF
-tmpfiles="$tmpfiles mfi-test3.out"
: ${MSGFILTER=msgfilter}
LC_ALL=C \
${MSGFILTER} --properties-input --properties-output -i mfi-test3.properties -o mfi-test3.out fold -b -s -w 20
result=$?
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
-tmpfiles="$tmpfiles mfi-test3.ok"
cat <<\EOF > mfi-test3.ok
# HEADER.
#
${DIFF} mfi-test3.ok mfi-test3.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgfilter on a PO file with contexts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
sedoutput=`echo $ac_n "abc$ac_c" | sed -e s/x/x/`
test -n "$sedoutput" || {
echo "Skipping test: sed program is broken"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
# Some sed programs (IRIX, OSF/1 etc.) add a newline to the last line if it
sedoutputcount=`echo "$sedoutputcount" | sed -e 's/[ ]//g'`
test "$sedoutputcount" = 3 || {
echo "Skipping test: sed program inserts extra newline"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles mfi-test4.po"
cat <<\EOF > mfi-test4.po
msgid ""
msgstr ""
#~ msgstr "Enregistrer sous"
EOF
-tmpfiles="$tmpfiles mfi-test4.out mfi-test4.err"
: ${MSGFILTER=msgfilter}
sedexpr1='1{
s/^/\[\[/
${MSGFILTER} -i mfi-test4.po -o mfi-test4.out sed -e "$sedexpr1" -e "$sedexpr2" >mfi-test4.err 2>&1
result=$?
cat mfi-test4.err | grep -v 'warning: Locale charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
-tmpfiles="$tmpfiles mfi-test4.ok"
cat <<\EOF > mfi-test4.ok
msgid ""
msgstr ""
${DIFF} mfi-test4.ok mfi-test4.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgfilter with command recode-sr-latin1.
# Verify that it converts to UTF-8.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mfi-srl-1.po"
cat <<\EOF > mfi-srl-1.po
# Serbian translation of gettext-runtime
# Copyright (C) 2003 Free Software Foundation, Inc.
# of here documents in /bin/sh is too buggy. Skip the test in this case.
head -n 1 mfi-srl-1.po | grep Serbian > /dev/null || {
echo "Skipping test: /bin/sh is too buggy"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles mfi-srl-1.tmp mfi-srl-1.out"
: ${MSGFILTER=msgfilter}
-${MSGFILTER} -i mfi-srl-1.po -o mfi-srl-1.tmp recode-sr-latin
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mfi-srl-1.tmp > mfi-srl-1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGFILTER} -i mfi-srl-1.po -o mfi-srl-1.tmp recode-sr-latin || exit 1
+LC_ALL=C tr -d '\r' < mfi-srl-1.tmp > mfi-srl-1.out || exit 1
-tmpfiles="$tmpfiles mfi-srl-1.ok"
cat <<\EOF > mfi-srl-1.ok
# Serbian translation of gettext-runtime
# Copyright (C) 2003 Free Software Foundation, Inc.
${DIFF} mfi-srl-1.ok mfi-srl-1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test basic functionality, duplicate detection, multiple domains.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-1"
test -d mf-1 || mkdir mf-1
test -d mf-1/LC_MESSAGES || mkdir mf-1/LC_MESSAGES
-tmpfiles="$tmpfiles mf-1-module1.po mf-1-module2.po"
cat <<EOF > mf-1-module1.po
#default domain "messages.mo"
msgid "SYS_(C)\n"
# Without use of msgcat, expect a "duplicate message definition" error.
: ${MSGFMT=msgfmt}
if ${MSGFMT} -o mf-1/LC_MESSAGES/gen.mo mf-1-module1.po mf-1-module2.po 2> /dev/null; then
- rm -fr $tmpfiles
exit 1
fi
# With msgcat, it should work.
-tmpfiles="$tmpfiles mf-1-modules.po"
: ${MSGCAT=msgcat} ${MSGFMT=msgfmt}
-${MSGCAT} --use-first -o mf-1-modules.po mf-1-module1.po mf-1-module2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-${MSGFMT} -o mf-1/LC_MESSAGES/gen.mo mf-1-modules.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCAT} --use-first -o mf-1-modules.po mf-1-module1.po mf-1-module2.po || exit 1
+${MSGFMT} -o mf-1/LC_MESSAGES/gen.mo mf-1-modules.po || exit 1
-tmpfiles="$tmpfiles mf-test1.out"
: ${GETTEXT=gettext}
TEXTDOMAINDIR=. LANGUAGE=mf-1 \
${GETTEXT} --env LC_ALL=en gen 'SYS_(C)
' | LC_ALL=C tr -d '\r' > mf-test1.out
-tmpfiles="$tmpfiles gtmf-test1.ok"
cat <<EOF > gtmf-test1.ok
MSGFMT(3) portable message object file compiler
Copyright (C) 1995 Free Software Foundation
${DIFF} gtmf-test1.ok mf-test1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test format string checking in plural entries.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-test10.po1"
cat <<\EOF > mf-test10.po1
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
EOF
: ${MSGFMT=msgfmt}
-${MSGFMT} --check -o /dev/null mf-test10.po1
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGFMT} --check -o /dev/null mf-test10.po1 || exit 1
-tmpfiles="$tmpfiles mf-test10.po2"
cat <<\EOF > mf-test10.po2
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr[1] "%d yararsýz kural%s"
EOF
-tmpfiles="$tmpfiles mf-test10.err"
: ${MSGFMT=msgfmt}
LC_MESSAGES=C LC_ALL= \
${MSGFMT} --check -o /dev/null mf-test10.po2 \
2>&1 | grep -v '^==' | sed -e 's|[^ ]*\\msgfmt\.exe|msgfmt|' -e 's|^msgfmt\.exe|msgfmt|' | LC_ALL=C tr -d '\r' > mf-test10.err
-tmpfiles="$tmpfiles mf-test10.ok"
cat << EOF > mf-test10.ok
mf-test10.po2:6: warning: header field 'Language' missing in header
mf-test10.po2:20: number of format specifications in 'msgid_plural' and 'msgstr[1]' does not match
${DIFF} mf-test10.ok mf-test10.err
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test handling of invalid multibyte sequences.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-11.po"
cat <<\EOF > mf-11.po
msgid ""
msgstr ""
msgstr "_õצÍËÎÕÔÉ ÓÐÅæÁÌØÎ¦ ÍÏÖÌÉ×ÏÓÔ¦ ËÌÁצÁÔÕÒÉ"
EOF
-tmpfiles="$tmpfiles mf-11.mo core *.core"
: ${MSGFMT=msgfmt}
${MSGFMT} --check -o mf-11.mo mf-11.po 2>/dev/null
# Exit code must be 1.
test $? = 1
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test ISO C 99 <inttypes.h> format string directives.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-12.po"
cat <<\EOF > mf-12.po
msgid ""
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
msgstr "<PRIXFAST16> Fehler"
EOF
-tmpfiles="$tmpfiles mf-12.mo"
: ${MSGFMT=msgfmt}
-${MSGFMT} -o mf-12.mo mf-12.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGFMT} -o mf-12.mo mf-12.po || exit 1
-tmpfiles="$tmpfiles mf-12.tmp mf-12.out"
: ${MSGUNFMT=msgunfmt}
-${MSGUNFMT} -o mf-12.tmp mf-12.mo
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mf-12.tmp > mf-12.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNFMT} -o mf-12.tmp mf-12.mo || exit 1
+LC_ALL=C tr -d '\r' < mf-12.tmp > mf-12.out || exit 1
-tmpfiles="$tmpfiles mf-12.ok"
cat <<\EOF > mf-12.ok
msgid ""
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
${DIFF} mf-12.ok mf-12.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test that an out-of-range Unicode character doesn't lead to a crash.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-test13.po"
cat <<\EOF >mf-test13.po
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
EOF
-tmpfiles="$tmpfiles mf-test13.mo"
: ${MSGFMT=msgfmt}
${MSGFMT} mf-test13.po -o mf-test13.mo 2>/dev/null
# Exit code must be 1.
test $? = 1
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgfmt and msgunfmt on a PO file with contexts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-14.po"
cat <<\EOF > mf-14.po
msgid ""
msgstr ""
#~ msgstr "Enregistrer sous"
EOF
-tmpfiles="$tmpfiles mf-14.mo"
: ${MSGFMT=msgfmt}
-${MSGFMT} -o mf-14.mo mf-14.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGFMT} -o mf-14.mo mf-14.po || exit 1
-tmpfiles="$tmpfiles mf-14.tmp mf-14.out"
: ${MSGUNFMT=msgunfmt}
-${MSGUNFMT} -o mf-14.tmp mf-14.mo
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mf-14.tmp > mf-14.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNFMT} -o mf-14.tmp mf-14.mo || exit 1
+LC_ALL=C tr -d '\r' < mf-14.tmp > mf-14.out || exit 1
-tmpfiles="$tmpfiles mf-14.ok"
cat <<\EOF > mf-14.ok
msgid ""
msgstr ""
${DIFF} mf-14.ok mf-14.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test plural formula dependent checking of format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# Take as example a plural formula which takes the values 0 and 2 infinitely
# often, and value 1 only a few times.
# Test: 1 - have %d everywhere - OK
# 3 - lack %d for value 1 - OK
# 4 - lack %d for value 2 - error
-tmpfiles="$tmpfiles mf-15.po1"
cat <<\EOF > mf-15.po1
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
EOF
: ${MSGFMT=msgfmt}
-${MSGFMT} --check -o /dev/null mf-15.po1
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGFMT} --check -o /dev/null mf-15.po1 || exit 1
-tmpfiles="$tmpfiles mf-15.po2"
cat <<\EOF > mf-15.po2
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
: ${MSGFMT=msgfmt}
${MSGFMT} --check -o /dev/null mf-15.po2 2>/dev/null
-test $? = 1 || { rm -fr $tmpfiles; exit 1; }
+test $? = 1 || { exit 1; }
-tmpfiles="$tmpfiles mf-15.po3"
cat <<\EOF > mf-15.po3
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
EOF
: ${MSGFMT=msgfmt}
-${MSGFMT} --check -o /dev/null mf-15.po3
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGFMT} --check -o /dev/null mf-15.po3 || exit 1
-tmpfiles="$tmpfiles mf-15.po4"
cat <<\EOF > mf-15.po4
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
: ${MSGFMT=msgfmt}
${MSGFMT} --check -o /dev/null mf-15.po4 2>/dev/null
-test $? = 1 || { rm -fr $tmpfiles; exit 1; }
-
-rm -fr $tmpfiles
+test $? = 1 || { exit 1; }
exit $result
# Test msgfmt on a PO file with previous msgids.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-16.po"
cat <<\EOF > mf-16.po
msgid ""
msgstr ""
#~ msgstr "%s: ungültige Option -- %c\n"
EOF
-tmpfiles="$tmpfiles mf-16.mo"
: ${MSGFMT=msgfmt}
-${MSGFMT} -o mf-16.mo mf-16.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGFMT} -o mf-16.mo mf-16.po || exit 1
-tmpfiles="$tmpfiles mf-16.tmp mf-16.out"
: ${MSGUNFMT=msgunfmt}
-${MSGUNFMT} -o mf-16.tmp mf-16.mo
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mf-16.tmp > mf-16.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNFMT} -o mf-16.tmp mf-16.mo || exit 1
+LC_ALL=C tr -d '\r' < mf-16.tmp > mf-16.out || exit 1
-tmpfiles="$tmpfiles mf-16.ok"
cat <<\EOF > mf-16.ok
msgid ""
msgstr ""
${DIFF} mf-16.ok mf-16.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test range dependent checking of format strings with plural forms.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# Take as example a plural formula which takes all values infinitely often.
# Test: 1 - lack %d for value 0 - error
# 2 - lack %d for value 0 but limited range such that only one n - ok
# 3 - lack %d for value 1 - error
# 4 - lack %d for value 1 but limited range such that multiple n - error
-tmpfiles="$tmpfiles mf-17.po1"
cat <<\EOF > mf-17.po1
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
: ${MSGFMT=msgfmt}
${MSGFMT} --check -o /dev/null mf-17.po1 2>/dev/null
-test $? = 1 || { rm -fr $tmpfiles; exit 1; }
+test $? = 1 || { exit 1; }
-tmpfiles="$tmpfiles mf-17.po2"
cat <<\EOF > mf-17.po2
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
EOF
: ${MSGFMT=msgfmt}
-${MSGFMT} --check -o /dev/null mf-17.po2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGFMT} --check -o /dev/null mf-17.po2 || exit 1
-tmpfiles="$tmpfiles mf-17.po3"
cat <<\EOF > mf-17.po3
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
: ${MSGFMT=msgfmt}
${MSGFMT} --check -o /dev/null mf-17.po3 2>/dev/null
-test $? = 1 || { rm -fr $tmpfiles; exit 1; }
+test $? = 1 || { exit 1; }
-tmpfiles="$tmpfiles mf-17.po4"
cat <<\EOF > mf-17.po4
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
: ${MSGFMT=msgfmt}
${MSGFMT} --check -o /dev/null mf-17.po4 2>/dev/null
-test $? = 1 || { rm -fr $tmpfiles; exit 1; }
-
-rm -fr $tmpfiles
+test $? = 1 || { exit 1; }
exit $result
ac_n= ac_c='\c' ac_t=
fi
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-2"
test -d mf-2 || mkdir mf-2
test -d mf-2/LC_MESSAGES || mkdir mf-2/LC_MESSAGES
-tmpfiles="$tmpfiles mf-2-module1.po mf-2-module2.po"
cat <<EOF > mf-2-module1.po
#default domain "messages.mo"
msgid "SYS_(C)\n"
# Without use of msgcat, expect a "duplicate message definition" error.
: ${MSGFMT=msgfmt}
if ${MSGFMT} -o mf-2/LC_MESSAGES/gen.mo mf-2-module1.po mf-2-module2.po 2> /dev/null; then
- rm -fr $tmpfiles
exit 1
fi
# With msgcat, it should work.
-tmpfiles="$tmpfiles mf-2-modules.po"
: ${MSGCAT=msgcat} ${MSGFMT=msgfmt}
-${MSGCAT} --use-first -o mf-2-modules.po mf-2-module1.po mf-2-module2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-${MSGFMT} -o mf-2/LC_MESSAGES/gen.mo mf-2-modules.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCAT} --use-first -o mf-2-modules.po mf-2-module1.po mf-2-module2.po || exit 1
+${MSGFMT} -o mf-2/LC_MESSAGES/gen.mo mf-2-modules.po || exit 1
-tmpfiles="$tmpfiles mf-test2.out"
: ${GETTEXT=gettext}
TEXTDOMAINDIR=. LANGUAGE=mf-2 \
${GETTEXT} --env LC_ALL=en gen 'error 3' > mf-test2.out
-tmpfiles="$tmpfiles gtmf-test2.ok"
echo $ac_n "error 3 translation$ac_c" > gtmf-test2.ok
: ${DIFF=diff}
${DIFF} gtmf-test2.ok mf-test2.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test that an empty header entry is OK.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-test3.po"
cat <<EOF >mf-test3.po
#
# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
msgstr ""
EOF
-tmpfiles="$tmpfiles mftest3.mo mftest3.err"
: ${MSGFMT=msgfmt}
LC_MESSAGES=C LC_ALL= \
${MSGFMT} -o mftest3.mo mf-test3.po >mftest3.err 2>&1
result=$?
cat mftest3.err | grep -v 'warning: Charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
test ! -f mftest3.mo
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test c-format handling.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-test4.po"
cat <<EOF >mf-test4.po
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
${MSGFMT} -o /dev/null mf-test4.po 2> /dev/null
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test multi-domain handling.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles foo.po"
cat <<\EOF > foo.po
domain "foo-de"
msgid ""
msgstr "A bientôt"
EOF
-tmpfiles="$tmpfiles foo-de.mo foo-fr.mo"
: ${MSGFMT=msgfmt}
-${MSGFMT} foo.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGFMT} foo.po || exit 1
-tmpfiles="$tmpfiles foo-de.tmp foo-de.out foo-fr.tmp foo-fr.out"
: ${MSGUNFMT=msgunfmt}
-${MSGUNFMT} -o foo-de.tmp foo-de.mo
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < foo-de.tmp > foo-de.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-${MSGUNFMT} -o foo-fr.tmp foo-fr.mo
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < foo-fr.tmp > foo-fr.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-
-tmpfiles="$tmpfiles foo-de.ok"
+${MSGUNFMT} -o foo-de.tmp foo-de.mo || exit 1
+LC_ALL=C tr -d '\r' < foo-de.tmp > foo-de.out || exit 1
+${MSGUNFMT} -o foo-fr.tmp foo-fr.mo || exit 1
+LC_ALL=C tr -d '\r' < foo-fr.tmp > foo-fr.out || exit 1
+
cat <<\EOF > foo-de.ok
msgid ""
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
msgstr "Hallo"
EOF
-tmpfiles="$tmpfiles foo-fr.ok"
cat <<\EOF > foo-fr.ok
msgid ""
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
${DIFF} foo-de.ok foo-de.out && ${DIFF} foo-fr.ok foo-fr.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Note: On AIX 3 with xlc, this test fails. To make it work, add "-qcheck"
# to the CFLAGS, or use gcc.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-6.po"
cat <<EOF > mf-6.po
msgid ""
msgstr ""
"Plural-Forms: nplurals=3; plural=(1 + (1 / (n - 257)));\n"
EOF
-tmpfiles="$tmpfiles mf-6.mo core *.core"
: ${MSGFMT=msgfmt}
${MSGFMT} --check -o mf-6.mo mf-6.po 2>/dev/null
# Exit code must be 1.
test $? = 1
result=$?
-rm -fr $tmpfiles
-
exit $result
# Check for duplicates with identical translations
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-test7.in1"
cat <<EOF > mf-test7.in1
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgid "3" msgstr "3"
EOF
-tmpfiles="$tmpfiles mf-test7.err"
: ${MSGFMT=msgfmt}
LC_MESSAGES=C LC_ALL= \
${MSGFMT} --verbose --check mf-test7.in1 -o /dev/null \
2>&1 | grep -v '^==' | sed -e 's|[^ ]*\\msgfmt\.exe|msgfmt|' -e 's|^msgfmt\.exe|msgfmt|' | LC_ALL=C tr -d '\r' > mf-test7.err
-tmpfiles="$tmpfiles mf-test7.ok"
cat << EOF > mf-test7.ok
mf-test7.in1:17: duplicate message definition...
mf-test7.in1:16: ...this is the location of the first definition
${DIFF} mf-test7.ok mf-test7.err
result=$?
-rm -fr $tmpfiles
-
exit $result
# Check for duplicates with different translations
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-test8.in1"
cat <<EOF > mf-test8.in1
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgid "3" msgstr "three ha ha"
EOF
-tmpfiles="$tmpfiles mf-test8.err"
: ${MSGFMT=msgfmt}
LC_MESSAGES=C LC_ALL= \
${MSGFMT} --verbose --check mf-test8.in1 -o /dev/null \
2>&1 | grep -v '^==' | sed -e 's|[^ ]*\\msgfmt\.exe|msgfmt|' -e 's|^msgfmt\.exe|msgfmt|' | LC_ALL=C tr -d '\r' > mf-test8.err
-tmpfiles="$tmpfiles mf-test8.ok"
cat << EOF > mf-test8.ok
mf-test8.in1:17: duplicate message definition...
mf-test8.in1:16: ...this is the location of the first definition
${DIFF} mf-test8.ok mf-test8.err
result=$?
-rm -fr $tmpfiles
-
exit $result
# Duplicates are also fatal in obsolete marked entries.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-test9.in1"
cat <<EOF > mf-test9.in1
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
#~ "ha ha"
EOF
-tmpfiles="$tmpfiles mf-test9.err"
: ${MSGFMT=msgfmt}
LC_MESSAGES=C LC_ALL= \
${MSGFMT} --verbose --check mf-test9.in1 -o /dev/null \
2>&1 | grep -v '^==' | sed -e 's|[^ ]*\\msgfmt\.exe|msgfmt|' -e 's|^msgfmt\.exe|msgfmt|' | LC_ALL=C tr -d '\r' > mf-test9.err
-tmpfiles="$tmpfiles mf-test9.ok"
cat << EOF > mf-test9.ok
mf-test9.in1:17: duplicate message definition...
mf-test9.in1:15: ...this is the location of the first definition
${DIFF} mf-test9.ok mf-test9.err
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test basic functioning with Java .properties syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-p-1"
test -d mf-p-1 || mkdir mf-p-1
test -d mf-p-1/LC_MESSAGES || mkdir mf-p-1/LC_MESSAGES
-tmpfiles="$tmpfiles mf-p-1-1.properties mf-p-1-2.properties"
cat <<\EOF > mf-p-1-1.properties
SYS_(C)\n=MSGFMT(3) portable message object file compiler\nCopyright (C) 1995 Free Software Foundation\nReport bugs to <bug-gnu-utils@gnu.org>\n
msg\ 1=msg 1 translation
# Without use of msgcat, expect a "duplicate message definition" error.
: ${MSGFMT=msgfmt}
if ${MSGFMT} --properties-input -o mf-p-1/LC_MESSAGES/gen.mo mf-p-1-1.properties mf-p-1-2.properties 2> /dev/null; then
- rm -fr $tmpfiles
exit 1
fi
# With msgcat, it should work.
-tmpfiles="$tmpfiles mf-p-1-s.properties"
: ${MSGCAT=msgcat} ${MSGFMT=msgfmt}
-${MSGCAT} --properties-input --properties-output --use-first -o mf-p-1-s.properties mf-p-1-1.properties mf-p-1-2.properties
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-${MSGFMT} --properties-input -o mf-p-1/LC_MESSAGES/gen.mo mf-p-1-s.properties
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCAT} --properties-input --properties-output --use-first -o mf-p-1-s.properties mf-p-1-1.properties mf-p-1-2.properties || exit 1
+${MSGFMT} --properties-input -o mf-p-1/LC_MESSAGES/gen.mo mf-p-1-s.properties || exit 1
-tmpfiles="$tmpfiles mf-p-test1.out"
: ${GETTEXT=gettext}
TEXTDOMAINDIR=. LANGUAGE=mf-p-1 \
${GETTEXT} --env LC_ALL=en gen 'SYS_(C)
' | LC_ALL=C tr -d '\r' > mf-p-test1.out
-tmpfiles="$tmpfiles gtmf-p-test1.ok"
cat <<EOF > gtmf-p-test1.ok
MSGFMT(3) portable message object file compiler
Copyright (C) 1995 Free Software Foundation
${DIFF} gtmf-p-test1.ok mf-p-test1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test output in Qt .qm format.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-qt-1.qm"
: ${MSGFMT=msgfmt}
-${MSGFMT} --qt -o mf-qt-1.qm "$abs_srcdir"/qttest_pl.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGFMT} --qt -o mf-qt-1.qm "$abs_srcdir"/qttest_pl.po || exit 1
: ${CMP=cmp}
${CMP} "$abs_srcdir"/qttest_pl.qm mf-qt-1.qm >/dev/null 2>/dev/null
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgfmt --qt on a PO file with contexts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mf-qt-2.qm"
: ${MSGFMT=msgfmt}
-${MSGFMT} --qt "$abs_srcdir"/qttest2_de.po -o mf-qt-2.qm
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGFMT} --qt "$abs_srcdir"/qttest2_de.po -o mf-qt-2.qm || exit 1
: ${CMP=cmp}
${CMP} "$abs_srcdir"/qttest2_de.qm mf-qt-2.qm >/dev/null 2>/dev/null
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --location option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mg-test1.po"
cat <<\EOF > mg-test1.po
# German translations for GNU gettext package.
# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
msgstr "Subprozess %s hat ein fatales Signal erhalten"
EOF
-tmpfiles="$tmpfiles mg-test1.tmp mg-test1.out"
: ${MSGGREP=msggrep}
-${MSGGREP} -N pipe-bidi.c -o mg-test1.tmp mg-test1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mg-test1.tmp > mg-test1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGGREP} -N pipe-bidi.c -o mg-test1.tmp mg-test1.po || exit 1
+LC_ALL=C tr -d '\r' < mg-test1.tmp > mg-test1.out || exit 1
-tmpfiles="$tmpfiles mg-test1.ok"
cat <<\EOF > mg-test1.ok
# German translations for GNU gettext package.
# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
${DIFF} mg-test1.ok mg-test1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# <https://bugzilla.redhat.com/show_bug.cgi?id=483181>
# <https://savannah.gnu.org/bugs/?25437>
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
: ${MSGGREP=msggrep}
-echo a=b | LC_MESSAGES=C LC_ALL= ${MSGGREP} -P -K -e '^a$' > /dev/null
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-
-rm -fr $tmpfiles
+echo a=b | LC_MESSAGES=C LC_ALL= ${MSGGREP} -P -K -e '^a$' > /dev/null || exit 1
exit $result
# Test --domain option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mg-test2.po"
cat <<\EOF > mg-test2.po
domain "de"
msgstr "%s: l'option « -W %s » ne tolère pas d'argument\n"
EOF
-tmpfiles="$tmpfiles mg-test2.tmp mg-test2.out"
: ${MSGGREP=msggrep}
-${MSGGREP} -M fr -o mg-test2.tmp mg-test2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mg-test2.tmp > mg-test2.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGGREP} -M fr -o mg-test2.tmp mg-test2.po || exit 1
+LC_ALL=C tr -d '\r' < mg-test2.tmp > mg-test2.out || exit 1
-tmpfiles="$tmpfiles mg-test2.ok"
cat <<\EOF > mg-test2.ok
domain "de"
${DIFF} mg-test2.ok mg-test2.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --msgid and --msgstr options.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mg-test3.po"
cat <<\EOF > mg-test3.po
# German translations for GNU gettext package.
# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
msgstr "Antiterror-Einheit"
EOF
-tmpfiles="$tmpfiles mg-test3.tmp mg-test3.err mg-test3.out"
: ${MSGGREP=msggrep}
LC_MESSAGES=C LC_ALL= \
${MSGGREP} -K -e error -T -e Speicher -o mg-test3.tmp mg-test3.po >mg-test3.err 2>&1
result=$?
cat mg-test3.err | grep -v 'warning: Locale charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mg-test3.tmp > mg-test3.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < mg-test3.tmp > mg-test3.out || exit 1
-tmpfiles="$tmpfiles mg-test3.ok"
cat <<\EOF > mg-test3.ok
# German translations for GNU gettext package.
# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
${DIFF} mg-test3.ok mg-test3.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test multiple -e and multiple -f options.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mg-test4.po"
cat <<\EOF > mg-test4.po
# German translations for GNU gettext package.
# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
msgstr "Subprozess %s hat ein fatales Signal erhalten"
EOF
-tmpfiles="$tmpfiles mg-test4.in1"
echo 'invalid' > mg-test4.in1
-tmpfiles="$tmpfiles mg-test4.in2"
echo 'illegal' > mg-test4.in2
-tmpfiles="$tmpfiles mg-test4.tmp mg-test4.err mg-test4.out"
: ${MSGGREP=msggrep}
LC_MESSAGES=C LC_ALL= \
${MSGGREP} -K -e error -f mg-test4.in1 -f mg-test4.in2 -e cannot -o mg-test4.tmp mg-test4.po > mg-test4.err 2>&1
result=$?
cat mg-test4.err | grep -v 'warning: Locale charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mg-test4.tmp > mg-test4.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < mg-test4.tmp > mg-test4.out || exit 1
-tmpfiles="$tmpfiles mg-test4.ok"
cat <<\EOF > mg-test4.ok
# German translations for GNU gettext package.
# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
${DIFF} mg-test4.ok mg-test4.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --comment option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mg-test5.po"
cat <<\EOF > mg-test5.po
# German translations for GNU gettext package.
# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
msgstr "Antiterror-Einheit"
EOF
-tmpfiles="$tmpfiles mg-test5.tmp mg-test5.err mg-test5.out"
: ${MSGGREP=msggrep}
LC_MESSAGES=C LC_ALL= \
${MSGGREP} -C -e @proofread -o mg-test5.tmp mg-test5.po >mg-test5.err 2>&1
result=$?
cat mg-test5.err | grep -v 'warning: Locale charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mg-test5.tmp > mg-test5.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < mg-test5.tmp > mg-test5.out || exit 1
-tmpfiles="$tmpfiles mg-test5.ok"
cat <<\EOF > mg-test5.ok
# German translations for GNU gettext package.
# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
${DIFF} mg-test5.ok mg-test5.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --msgid and --msgstr options with Java .properties syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mg-test6.properties"
cat <<\EOF > mg-test6.properties
#: argmatch.c:141
#, c-format
GSG-9=Antiterror-Einheit
EOF
-tmpfiles="$tmpfiles mg-test6.tmp mg-test6.out"
: ${MSGGREP=msggrep}
LC_MESSAGES=C LC_ALL= \
${MSGGREP} --properties-input --properties-output -K -e error -T -e Speicher -o mg-test6.tmp mg-test6.properties
result=$?
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mg-test6.tmp > mg-test6.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < mg-test6.tmp > mg-test6.out || exit 1
-tmpfiles="$tmpfiles mg-test6.ok"
cat <<\EOF > mg-test6.ok
#: copy-file.c:60
#, c-format
${DIFF} mg-test6.ok mg-test6.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msggrep on a PO file with contexts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mg-test7.po"
cat <<\EOF > mg-test7.po
msgid ""
msgstr ""
#~ msgstr "Enregistrer sous"
EOF
-tmpfiles="$tmpfiles mg-test7.tmp mg-test7.out mg-test7.err"
: ${MSGGREP=msggrep}
LC_MESSAGES=C LC_ALL= \
${MSGGREP} -J -e "File|" -o mg-test7.tmp mg-test7.po 2> mg-test7.err
result=$?
cat mg-test7.err | grep -v 'warning: Locale charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mg-test7.tmp > mg-test7.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < mg-test7.tmp > mg-test7.out || exit 1
-tmpfiles="$tmpfiles mg-test7.ok"
cat <<\EOF > mg-test7.ok
msgid ""
msgstr ""
${DIFF} mg-test7.ok mg-test7.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --extracted-comment option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mg-test8.po"
cat <<\EOF > mg-test8.po
msgid ""
msgstr ""
msgstr "%d mal wiederholen"
EOF
-tmpfiles="$tmpfiles mg-test8.tmp mg-test8.err mg-test8.out"
: ${MSGGREP=msggrep}
LC_MESSAGES=C LC_ALL= \
${MSGGREP} -X -e c-form -o mg-test8.tmp mg-test8.po >mg-test8.err 2>&1
result=$?
cat mg-test8.err | grep -v 'warning: Locale charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mg-test8.tmp > mg-test8.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < mg-test8.tmp > mg-test8.out || exit 1
-tmpfiles="$tmpfiles mg-test8.ok"
cat <<\EOF > mg-test8.ok
msgid ""
msgstr ""
${DIFF} mg-test8.ok mg-test8.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test interpretation of $ as end-of-line anchor.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mg-test9.po"
cat <<\EOF > mg-test9.po
# German translations for GNU gettext package.
# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
msgstr "Subprozess %s hat ein fatales Signal erhalten"
EOF
-tmpfiles="$tmpfiles mg-test9.tmp mg-test9.err mg-test9.out"
: ${MSGGREP=msggrep}
LC_MESSAGES=C LC_ALL= \
${MSGGREP} -K -e 'argument$' -o mg-test9.tmp mg-test9.po > mg-test9.err 2>&1
result=$?
cat mg-test9.err | grep -v 'warning: Locale charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mg-test9.tmp > mg-test9.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < mg-test9.tmp > mg-test9.out || exit 1
-tmpfiles="$tmpfiles mg-test9.ok"
cat <<\EOF > mg-test9.ok
# German translations for GNU gettext package.
# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
${DIFF} mg-test9.ok mg-test9.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test plural count for locales with nplurals != 2.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mi-test1.pot"
cat <<\EOF > mi-test1.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
msgstr ""
EOF
-tmpfiles="$tmpfiles mi-test1.tmp mi-test1.out mi-test1.err"
: ${MSGINIT=msginit}
${MSGINIT} -i mi-test1.pot -l ga_IE --no-translator -o mi-test1.tmp 2>mi-test1.err
-test $? = 0 || { cat mi-test1.err 1>&2; rm -fr $tmpfiles; exit 1; }
+test $? = 0 || { cat mi-test1.err 1>&2; exit 1; }
# The charset stored in the header entry is the locale encoding of the gl_IE
# locale, which is system dependent, or ASCII if the locale does not exist.
-sed -e '1,10d' -e 's/\(ISO-8859-1\|CP1252\|UTF-8\)/ASCII/g' < mi-test1.tmp | LC_ALL=C tr -d '\r' > mi-test1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+sed -e '1,10d' -e 's/\(ISO-8859-1\|CP1252\|UTF-8\)/ASCII/g' < mi-test1.tmp | LC_ALL=C tr -d '\r' > mi-test1.out || exit 1
-tmpfiles="$tmpfiles mi-test1.ok"
cat <<\EOF > mi-test1.ok
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
${DIFF} mi-test1.ok mi-test1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msginit on a POT file with contexts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mi-test2.pot"
cat <<\EOF > mi-test2.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
#~ msgstr ""
EOF
-tmpfiles="$tmpfiles mi-test2.tmp mi-test2.out mi-test2.err"
: ${MSGINIT=msginit}
${MSGINIT} -i mi-test2.pot -l ga_IE --no-translator -o mi-test2.tmp 2>mi-test2.err
-test $? = 0 || { cat mi-test2.err 1>&2; rm -fr $tmpfiles; exit 1; }
-sed -e '1,10d' < mi-test2.tmp | LC_ALL=C tr -d '\r' > mi-test2.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $? = 0 || { cat mi-test2.err 1>&2; exit 1; }
+sed -e '1,10d' < mi-test2.tmp | LC_ALL=C tr -d '\r' > mi-test2.out || exit 1
-tmpfiles="$tmpfiles mi-test2.ok"
cat <<\EOF > mi-test2.ok
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
${DIFF} mi-test2.ok mi-test2.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test general operation and line wrapping.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test1.in1 mm-test1.in2"
cat <<EOF > mm-test1.in1
# first
#. this should be discarded
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test1.tmp mm-test1.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test1.tmp mm-test1.in1 mm-test1.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test1.tmp > mm-test1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test1.tmp mm-test1.in1 mm-test1.in2 || exit 1
+LC_ALL=C tr -d '\r' < mm-test1.tmp > mm-test1.out || exit 1
-tmpfiles="$tmpfiles mm-test1.ok"
cat << EOF > mm-test1.ok
# first
#. this is the first
${DIFF} mm-test1.ok mm-test1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test merging of a message which has plural forms in ref.pot but not
# in def.po.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test10.po"
cat <<EOF > mm-test10.po
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr "%d erreur"
EOF
-tmpfiles="$tmpfiles mm-test10.pot"
cat <<EOF > mm-test10.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr[1] ""
EOF
-tmpfiles="$tmpfiles mm-test10.tmp mm-test10.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test10.tmp mm-test10.po mm-test10.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test10.tmp > mm-test10.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test10.tmp mm-test10.po mm-test10.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test10.tmp > mm-test10.out || exit 1
-tmpfiles="$tmpfiles mm-test10.ok"
cat <<EOF > mm-test10.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
${DIFF} mm-test10.ok mm-test10.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test merging of a message which has plural forms in ref.pot but not
# in def.po.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test11.po"
cat <<EOF > mm-test11.po
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr "%d erreur"
EOF
-tmpfiles="$tmpfiles mm-test11.pot"
cat <<EOF > mm-test11.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr[1] ""
EOF
-tmpfiles="$tmpfiles mm-test11.tmp mm-test11.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test11.tmp mm-test11.po mm-test11.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test11.tmp > mm-test11.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test11.tmp mm-test11.po mm-test11.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test11.tmp > mm-test11.out || exit 1
-tmpfiles="$tmpfiles mm-test11.ok"
cat <<EOF > mm-test11.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
${DIFF} mm-test11.ok mm-test11.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test merging of a message which has plural forms in def.po but not
# in ref.pot.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test12.po"
cat <<EOF > mm-test12.po
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr[1] "%d erreurs"
EOF
-tmpfiles="$tmpfiles mm-test12.pot"
cat <<EOF > mm-test12.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test12.tmp mm-test12.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test12.tmp mm-test12.po mm-test12.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test12.tmp > mm-test12.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test12.tmp mm-test12.po mm-test12.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test12.tmp > mm-test12.out || exit 1
-tmpfiles="$tmpfiles mm-test12.ok"
cat <<EOF > mm-test12.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
${DIFF} mm-test12.ok mm-test12.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test merging of a message which has c-format specified in ref.pot but not
# in def.po.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test13.po"
cat <<EOF > mm-test13.po
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr "%-Satz"
EOF
-tmpfiles="$tmpfiles mm-test13.pot"
cat <<EOF > mm-test13.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test13.tmp mm-test13.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test13.tmp mm-test13.po mm-test13.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test13.tmp > mm-test13.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test13.tmp mm-test13.po mm-test13.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test13.tmp > mm-test13.out || exit 1
-tmpfiles="$tmpfiles mm-test13.ok"
cat <<EOF > mm-test13.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
${DIFF} mm-test13.ok mm-test13.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# encoding (that was produced from an older version of ref.pot, in ASCII
# encoding).
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test14-ru.po"
cat <<\EOF > mm-test14-ru.po
# Russian messages for CLISP
# Copyright (C) 1998 Free Software Foundation, Inc.
msgstr "ÄÅÌÅÎÉÅ ÎÁ ÎÕÌØ"
EOF
-tmpfiles="$tmpfiles mm-test14.pot"
cat <<\EOF > mm-test14.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test14.tmp mm-test14.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test14.tmp mm-test14-ru.po mm-test14.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test14.tmp > mm-test14.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test14.tmp mm-test14-ru.po mm-test14.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test14.tmp > mm-test14.out || exit 1
-tmpfiles="$tmpfiles mm-test14.ok"
cat <<\EOF > mm-test14.ok
# Russian messages for CLISP
# Copyright (C) 1998 Free Software Foundation, Inc.
${DIFF} mm-test14.ok mm-test14.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test pseudo-comments containing filenames that start with a digit.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test15.pot mm-test15.po"
cat <<\EOF > mm-test15.pot
msgid ""
msgstr ""
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test15.tmp mm-test15.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test15.tmp mm-test15.pot mm-test15.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test15.tmp > mm-test15.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test15.tmp mm-test15.pot mm-test15.po || exit 1
+LC_ALL=C tr -d '\r' < mm-test15.tmp > mm-test15.out || exit 1
-tmpfiles="$tmpfiles mm-test15.ok"
cat <<\EOF > mm-test15.ok
msgid ""
msgstr ""
${DIFF} mm-test15.ok mm-test15.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test non-ASCII msgids when the PO file and the POT file are in different
# encodings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test16.po"
cat <<\EOF > mm-test16.po
msgid ""
msgstr ""
msgstr "b³±d %1."
EOF
-tmpfiles="$tmpfiles mm-test16.pot"
cat <<EOF > mm-test16.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Yoyodyne, Inc.
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test16.tmp.po mm-test16.new.po"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test16.tmp.po mm-test16.po mm-test16.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test16.tmp.po > mm-test16.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test16.tmp.po mm-test16.po mm-test16.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test16.tmp.po > mm-test16.new.po || exit 1
-tmpfiles="$tmpfiles mm-test16.ok"
cat <<\EOF > mm-test16.ok
msgid ""
msgstr ""
${DIFF} mm-test16.ok mm-test16.new.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test that untranslated messages that are brought over from the .pot file
# get the right number of msgstrs.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test17.po"
cat <<\EOF > mm-test17.po
# Irish translations.
msgid ""
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test17.pot"
cat <<\EOF > mm-test17.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test17.tmp.po mm-test17.new.po"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test17.tmp.po mm-test17.po mm-test17.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test17.tmp.po > mm-test17.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test17.tmp.po mm-test17.po mm-test17.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test17.tmp.po > mm-test17.new.po || exit 1
-tmpfiles="$tmpfiles mm-test17.ok"
cat <<\EOF > mm-test17.ok
# Irish translations.
msgid ""
${DIFF} mm-test17.ok mm-test17.new.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgmerge and msgcmp on a PO file with contexts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test18.po"
cat <<\EOF > mm-test18.po
msgid ""
msgstr ""
msgstr "photocopieur"
EOF
-tmpfiles="$tmpfiles mm-test18.pot"
cat <<\EOF > mm-test18.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
: ${MSGCMP=msgcmp}
${MSGCMP} --use-fuzzy --use-untranslated mm-test18.po mm-test18.pot 2>/dev/null
-test $? = 1 || { rm -fr $tmpfiles; exit 1; }
+test $? = 1 || { exit 1; }
-tmpfiles="$tmpfiles mm-test18.tmp.po mm-test18.new.po"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test18.tmp.po mm-test18.po mm-test18.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test18.tmp.po > mm-test18.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test18.tmp.po mm-test18.po mm-test18.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test18.tmp.po > mm-test18.new.po || exit 1
-tmpfiles="$tmpfiles mm-test18.ok"
# Note that the fuzzy guess for "Open" in context "Door state" could be either
# "Ouvrir" (from context "File|") or "Ouvert" (from context "Lock state").
cat <<\EOF > mm-test18.ok
EOF
: ${DIFF=diff}
-${DIFF} mm-test18.ok mm-test18.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${DIFF} mm-test18.ok mm-test18.new.po || exit 1
: ${MSGCMP=msgcmp}
-${MSGCMP} --use-fuzzy --use-untranslated mm-test18.new.po mm-test18.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-
-rm -fr $tmpfiles
+${MSGCMP} --use-fuzzy --use-untranslated mm-test18.new.po mm-test18.pot || exit 1
exit 0
# Test msgmerge --previous option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test19.po"
cat <<\EOF > mm-test19.po
msgid ""
msgstr ""
msgstr "%s: ungültige Option -- %c\n"
EOF
-tmpfiles="$tmpfiles mm-test19.pot"
cat <<\EOF > mm-test19.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test19.tmp.po mm-test19.new1.po"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q --previous -o mm-test19.tmp.po mm-test19.po mm-test19.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test19.tmp.po > mm-test19.new1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q --previous -o mm-test19.tmp.po mm-test19.po mm-test19.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test19.tmp.po > mm-test19.new1.po || exit 1
-tmpfiles="$tmpfiles mm-test19.ok1"
cat <<\EOF > mm-test19.ok1
msgid ""
msgstr ""
EOF
: ${DIFF=diff}
-${DIFF} mm-test19.ok1 mm-test19.new1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${DIFF} mm-test19.ok1 mm-test19.new1.po || exit 1
-tmpfiles="$tmpfiles mm-test19.pot"
cat <<\EOF > mm-test19.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test19.tmp.po mm-test19.new2.po"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q --previous -o mm-test19.tmp.po mm-test19.new1.po mm-test19.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test19.tmp.po > mm-test19.new2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q --previous -o mm-test19.tmp.po mm-test19.new1.po mm-test19.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test19.tmp.po > mm-test19.new2.po || exit 1
-tmpfiles="$tmpfiles mm-test19.ok2"
cat <<\EOF > mm-test19.ok2
msgid ""
msgstr ""
EOF
: ${DIFF=diff}
-${DIFF} mm-test19.ok2 mm-test19.new2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-
-rm -fr $tmpfiles
+${DIFF} mm-test19.ok2 mm-test19.new2.po || exit 1
exit 0
# Test recognition of duplicates.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test2.in1 mm-test2.in2"
cat <<EOF > mm-test2.in1
msgid "2" msgstr "2"
msgid "3" msgstr "3"
msgid "3" msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test2.out"
: ${MSGMERGE=msgmerge}
LC_MESSAGES=C LC_ALL= \
${MSGMERGE} -q -o /dev/stdout mm-test2.in1 mm-test2.in2 \
2>&1 | grep -v '^==' | sed -e 's|[^ ]*\\msgmerge\.exe|msgmerge|' -e 's|^msgmerge\.exe|msgmerge|' | LC_ALL=C tr -d '\r' > mm-test2.out
-tmpfiles="$tmpfiles mm-test2.ok"
cat << EOF > mm-test2.ok
mm-test2.in1:3: duplicate message definition...
mm-test2.in1:1: ...this is the location of the first definition
${DIFF} mm-test2.ok mm-test2.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msgmerge when the second argument is a PO file with obsolete messages
# (e.g. the result of an earlier msgmerge operation).
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test20.po"
cat <<\EOF > mm-test20.po
msgid ""
msgstr ""
msgstr "Dieses Programm läuft mit der Prozeß-Nummer {pid}."
EOF
-tmpfiles="$tmpfiles mm-test20.pot"
cat <<\EOF > mm-test20.pot
#, fuzzy
msgid ""
#~ msgstr "Dieses Programm läuft mit der Prozeß-Nummer {pid}."
EOF
-tmpfiles="$tmpfiles mm-test20.tmp.po mm-test20.new.po"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test20.tmp.po mm-test20.po mm-test20.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test20.tmp.po > mm-test20.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test20.tmp.po mm-test20.po mm-test20.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test20.tmp.po > mm-test20.new.po || exit 1
-tmpfiles="$tmpfiles mm-test20.ok"
cat <<\EOF > mm-test20.ok
msgid ""
msgstr ""
EOF
: ${DIFF=diff}
-${DIFF} mm-test20.ok mm-test20.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-
-rm -fr $tmpfiles
+${DIFF} mm-test20.ok mm-test20.new.po || exit 1
exit 0
# Test msgmerge when a message's flags have been changed from c-format to
# kde-format. Reported by Chusslove Illich (Часлав Илић).
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test21.po"
cat <<\EOF > mm-test21.po
msgid ""
msgstr ""
msgstr[1] "Engadir %n recursos dende o libro de enderezos"
EOF
-tmpfiles="$tmpfiles mm-test21.pot"
cat <<\EOF > mm-test21.pot
msgid ""
msgstr ""
msgstr[1] ""
EOF
-tmpfiles="$tmpfiles mm-test21.tmp.po mm-test21.new.po"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test21.tmp.po mm-test21.po mm-test21.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test21.tmp.po > mm-test21.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test21.tmp.po mm-test21.po mm-test21.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test21.tmp.po > mm-test21.new.po || exit 1
-tmpfiles="$tmpfiles mm-test21.ok"
cat <<\EOF > mm-test21.ok
msgid ""
msgstr ""
EOF
: ${DIFF=diff}
-${DIFF} mm-test21.ok mm-test21.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${DIFF} mm-test21.ok mm-test21.new.po || exit 1
-tmpfiles="$tmpfiles mm-test21.mo"
: ${MSGFMT=msgfmt}
-${MSGFMT} --check -o mm-test21.mo mm-test21.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-
-rm -fr $tmpfiles
+${MSGFMT} --check -o mm-test21.mo mm-test21.new.po || exit 1
exit 0
# Test msgmerge when a msgid_plural changed but msgid remained the same.
# Reported by Chusslove Illich (Часлав Илић).
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test22.po"
cat <<\EOF > mm-test22.po
msgid ""
msgstr ""
msgstr[1] "Engadir %n recursos dende o libro de enderezos"
EOF
-tmpfiles="$tmpfiles mm-test22.pot"
cat <<\EOF > mm-test22.pot
msgid ""
msgstr ""
msgstr[1] ""
EOF
-tmpfiles="$tmpfiles mm-test22.tmp.po mm-test22.new.po"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test22.tmp.po mm-test22.po mm-test22.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test22.tmp.po > mm-test22.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test22.tmp.po mm-test22.po mm-test22.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test22.tmp.po > mm-test22.new.po || exit 1
-tmpfiles="$tmpfiles mm-test22.ok"
cat <<\EOF > mm-test22.ok
msgid ""
msgstr ""
EOF
: ${DIFF=diff}
-${DIFF} mm-test22.ok mm-test22.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${DIFF} mm-test22.ok mm-test22.new.po || exit 1
-tmpfiles="$tmpfiles mm-test22.mo"
: ${MSGFMT=msgfmt}
-${MSGFMT} --check -o mm-test22.mo mm-test22.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-
-rm -fr $tmpfiles
+${MSGFMT} --check -o mm-test22.mo mm-test22.new.po || exit 1
exit 0
# and --previous was specified.
# Reported by Chusslove Illich (Часлав Илић).
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test23.po"
cat <<\EOF > mm-test23.po
msgid ""
msgstr ""
msgstr[1] "%n Bände"
EOF
-tmpfiles="$tmpfiles mm-test23.pot"
cat <<\EOF > mm-test23.pot
msgid ""
msgstr ""
msgstr[1] ""
EOF
-tmpfiles="$tmpfiles mm-test23.tmp.po mm-test23.new.po"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q --previous -o mm-test23.tmp.po mm-test23.po mm-test23.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test23.tmp.po > mm-test23.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q --previous -o mm-test23.tmp.po mm-test23.po mm-test23.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test23.tmp.po > mm-test23.new.po || exit 1
-tmpfiles="$tmpfiles mm-test23.ok"
cat <<\EOF > mm-test23.ok
msgid ""
msgstr ""
EOF
: ${DIFF=diff}
-${DIFF} mm-test23.ok mm-test23.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${DIFF} mm-test23.ok mm-test23.new.po || exit 1
-tmpfiles="$tmpfiles mm-test23.mo"
: ${MSGFMT=msgfmt}
-${MSGFMT} --check -o mm-test23.mo mm-test23.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-
-rm -fr $tmpfiles
+${MSGFMT} --check -o mm-test23.mo mm-test23.new.po || exit 1
exit 0
# Test msgmerge and msgcmp: handling of 'range:' flags.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test24.po"
cat <<\EOF > mm-test24.po
msgid ""
msgstr ""
msgstr[1] "cinq semaines et %d jours"
EOF
-tmpfiles="$tmpfiles mm-test24.pot"
cat <<\EOF > mm-test24.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
EOF
: ${MSGCMP=msgcmp}
-${MSGCMP} --use-fuzzy --use-untranslated mm-test24.po mm-test24.pot 2>/dev/null
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCMP} --use-fuzzy --use-untranslated mm-test24.po mm-test24.pot 2>/dev/null || exit 1
-tmpfiles="$tmpfiles mm-test24.tmp.po mm-test24.new.po"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test24.tmp.po mm-test24.po mm-test24.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test24.tmp.po > mm-test24.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test24.tmp.po mm-test24.po mm-test24.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test24.tmp.po > mm-test24.new.po || exit 1
-tmpfiles="$tmpfiles mm-test24.ok"
cat <<\EOF > mm-test24.ok
msgid ""
msgstr ""
EOF
: ${DIFF=diff}
-${DIFF} mm-test24.ok mm-test24.new.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${DIFF} mm-test24.ok mm-test24.new.po || exit 1
: ${MSGCMP=msgcmp}
-${MSGCMP} --use-fuzzy --use-untranslated mm-test24.new.po mm-test24.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-
-rm -fr $tmpfiles
+${MSGCMP} --use-fuzzy --use-untranslated mm-test24.new.po mm-test24.pot || exit 1
exit 0
# Test handling of obsolete/untranslated messages.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test3.in1 mm-test3.in2"
cat <<EOF > mm-test3.in1
#
# def.po
# trailing comments should be removed, even here
EOF
-tmpfiles="$tmpfiles mm-test3.tmp mm-test3.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test3.tmp mm-test3.in1 mm-test3.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test3.tmp > mm-test3.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test3.tmp mm-test3.in1 mm-test3.in2 || exit 1
+LC_ALL=C tr -d '\r' < mm-test3.tmp > mm-test3.out || exit 1
-tmpfiles="$tmpfiles mm-test3.ok"
cat << EOF > mm-test3.ok
#: file3:102
msgid "still existing"
${DIFF} mm-test3.ok mm-test3.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test handling of comments.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test4.in1.po mm-test4.in2.po"
cat <<EOF > mm-test4.in1.po
msgid "one"
msgstr "eins"
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test4.tmp mm-test4.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test4.tmp mm-test4.in1.po mm-test4.in2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test4.tmp > mm-test4.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test4.tmp mm-test4.in1.po mm-test4.in2.po || exit 1
+LC_ALL=C tr -d '\r' < mm-test4.tmp > mm-test4.out || exit 1
-tmpfiles="$tmpfiles mm-test4.ok"
cat <<EOF > mm-test4.ok
msgid "one"
msgstr "eins"
${DIFF} mm-test4.ok mm-test4.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test handling of header entry.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test5.in1.po mm-test5.in2.po"
cat <<EOF > mm-test5.in1.po
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
"blah blah blah blah blah blah blah blah blah blah blah blah blah bla bla bla\n"
EOF
-tmpfiles="$tmpfiles mm-test5.tmp mm-test5.out mm-test5.err"
: ${MSGMERGE=msgmerge}
LC_MESSAGES=C LC_ALL= \
${MSGMERGE} -q -o mm-test5.tmp mm-test5.in1.po mm-test5.in2.po >mm-test5.err 2>&1
result=$?
cat mm-test5.err | grep -v 'warning: Charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test5.tmp > mm-test5.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
+LC_ALL=C tr -d '\r' < mm-test5.tmp > mm-test5.out || exit 1
-tmpfiles="$tmpfiles mm-test5.ok"
cat <<EOF > mm-test5.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
${DIFF} mm-test5.ok mm-test5.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test non-ASCII character at the end of msgstr. (Triggered a glibc-2.1 bug.)
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test6.in1.po mm-test6.in2.po"
cat <<\EOF > mm-test6.in1.po
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test6.tmp mm-test6.out"
: ${MSGMERGE=msgmerge}
LC_MESSAGES=C LC_ALL= \
-${MSGMERGE} -q -o mm-test6.tmp mm-test6.in1.po mm-test6.in2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test6.tmp > mm-test6.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test6.tmp mm-test6.in1.po mm-test6.in2.po || exit 1
+LC_ALL=C tr -d '\r' < mm-test6.tmp > mm-test6.out || exit 1
-tmpfiles="$tmpfiles mm-test6.ok"
cat <<\EOF > mm-test6.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
${DIFF} mm-test6.ok mm-test6.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test multi-domain handling.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test7.po"
cat <<\EOF > mm-test7.po
domain "foo-de"
msgid ""
msgstr "A bientôt"
EOF
-tmpfiles="$tmpfiles mm-test7.pot"
cat <<EOF > mm-test7.pot
domain "foo-de"
msgid "Hello"
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test7.tmp mm-test7.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o mm-test7.tmp mm-test7.po mm-test7.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test7.tmp > mm-test7.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o mm-test7.tmp mm-test7.po mm-test7.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test7.tmp > mm-test7.out || exit 1
-tmpfiles="$tmpfiles mm-test7.ok"
cat <<\EOF > mm-test7.ok
domain "foo-de"
${DIFF} mm-test7.ok mm-test7.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test multi-domain handling.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test8.po"
cat <<\EOF > mm-test8.po
domain "foo-de"
msgid ""
msgstr "A bientôt"
EOF
-tmpfiles="$tmpfiles mm-test8.pot"
cat <<EOF > mm-test8.pot
msgid "Hello"
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test8.tmp mm-test8.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} --multi-domain -q -o mm-test8.tmp mm-test8.po mm-test8.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-test8.tmp > mm-test8.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} --multi-domain -q -o mm-test8.tmp mm-test8.po mm-test8.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-test8.tmp > mm-test8.out || exit 1
-tmpfiles="$tmpfiles mm-test8.ok"
cat <<\EOF > mm-test8.ok
domain "foo-de"
${DIFF} mm-test8.ok mm-test8.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Duplicates are also fatal in obsolete marked entries (cf. msgmerge-3).
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-test9.in1 mm-test9.in2"
cat <<EOF > mm-test9.in1
msgid "2" msgstr "2"
msgid "3" msgstr "3"
msgid "3" msgstr ""
EOF
-tmpfiles="$tmpfiles mm-test9.err"
: ${MSGMERGE=msgmerge}
LC_MESSAGES=C LC_ALL= \
${MSGMERGE} -q -o /dev/null mm-test9.in1 mm-test9.in2 \
2>&1 | grep -v '^==' | sed -e 's|[^ ]*\\msgmerge\.exe|msgmerge|' -e 's|^msgmerge\.exe|msgmerge|' | LC_ALL=C tr -d '\r' > mm-test9.err
-tmpfiles="$tmpfiles mm-test9.ok"
cat << EOF > mm-test9.ok
mm-test9.in1:3: duplicate message definition...
mm-test9.in1:1: ...this is the location of the first definition
${DIFF} mm-test9.ok mm-test9.err
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test compendium option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-c-1.in1 mm-c-1.com mm-c-1.pot"
cat <<EOF > mm-c-1.in1
#: file.c:123
msgid "1"
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-c-1.tmp mm-c-1.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -C mm-c-1.com -o mm-c-1.tmp mm-c-1.in1 mm-c-1.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-c-1.tmp > mm-c-1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -C mm-c-1.com -o mm-c-1.tmp mm-c-1.in1 mm-c-1.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-c-1.tmp > mm-c-1.out || exit 1
-tmpfiles="$tmpfiles mm-c-1.ok"
cat << EOF > mm-c-1.ok
#: file.c:123
msgid "1"
${DIFF} mm-c-1.ok mm-c-1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test compendium option with fuzziness.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-c-2.in1 mm-c-2.com mm-c-2.pot"
cat <<EOF > mm-c-2.in1
#: file.c:123
msgid "1"
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-c-2.tmp mm-c-2.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -C mm-c-2.com -o mm-c-2.tmp mm-c-2.in1 mm-c-2.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-c-2.tmp > mm-c-2.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -C mm-c-2.com -o mm-c-2.tmp mm-c-2.in1 mm-c-2.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-c-2.tmp > mm-c-2.out || exit 1
-tmpfiles="$tmpfiles mm-c-2.ok"
cat << EOF > mm-c-2.ok
#: file.c:123
msgid "1"
${DIFF} mm-c-2.ok mm-c-2.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# the old translation file (mm-c-3.in1) contains the same msgid
# Why not make use of the translation from the compendium?
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-c-3.in1 mm-c-3.com mm-c-3.pot"
cat <<EOF > mm-c-3.in1
#: file.c:123
msgid "1"
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-c-3.tmp mm-c-3.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -C mm-c-3.com -o mm-c-3.tmp mm-c-3.in1 mm-c-3.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-c-3.tmp > mm-c-3.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -C mm-c-3.com -o mm-c-3.tmp mm-c-3.in1 mm-c-3.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-c-3.tmp > mm-c-3.out || exit 1
-tmpfiles="$tmpfiles mm-c-3.ok"
cat << EOF > mm-c-3.ok
#: file.c:123
msgid "1"
${DIFF} mm-c-3.ok mm-c-3.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test compendium option. Use it there was no "old" PO file at all
# (merely use /dev/null).
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-c-4.com mm-c-4.pot"
cat <<\EOF > mm-c-4.com
msgid ""
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-c-4.tmp mm-c-4.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q --compendium mm-c-4.com -o mm-c-4.tmp /dev/null mm-c-4.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-c-4.tmp > mm-c-4.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q --compendium mm-c-4.com -o mm-c-4.tmp /dev/null mm-c-4.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-c-4.tmp > mm-c-4.out || exit 1
-tmpfiles="$tmpfiles mm-c-4.ok"
cat << \EOF > mm-c-4.ok
msgid ""
msgstr ""
${DIFF} mm-c-4.ok mm-c-4.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test compendium option with a large compendium.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-c-5.tmp mm-c-5.out"
: ${MSGMERGE=msgmerge}
${MSGMERGE} -q -o mm-c-5.tmp \
--compendium "$abs_srcdir"/mm-viet.comp.po \
- /dev/null "$abs_srcdir"/mm-viet.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-c-5.tmp > mm-c-5.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ /dev/null "$abs_srcdir"/mm-viet.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-c-5.tmp > mm-c-5.out || exit 1
: ${DIFF=diff}
${DIFF} "$abs_srcdir"/mm-viet.out mm-c-5.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# mm-ko.ascii.pot mm-ko.euc-kr.po mm-ko-comp.euc-kr.po
# mm-ko.utf-8.pot mm-ko.utf-8.po mm-ko-comp.utf-8.po
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-ko.utf-8.pot"
: ${MSGCONV=msgconv}
${MSGCONV} --to-code=UTF-8 -o mm-ko.utf-8.pot "$abs_srcdir"/mm-ko.ascii.pot
-tmpfiles="$tmpfiles mm-ko.utf-8.po"
: ${MSGCONV=msgconv}
${MSGCONV} --to-code=UTF-8 -o mm-ko.utf-8.po "$abs_srcdir"/mm-ko.euc-kr.po
-tmpfiles="$tmpfiles mm-ko-comp.utf-8.po"
: ${MSGCONV=msgconv}
${MSGCONV} --to-code=UTF-8 -o mm-ko-comp.utf-8.po "$abs_srcdir"/mm-ko-comp.euc-kr.po
-tmpfiles="$tmpfiles mm-c-6-AEE.tmp mm-c-6-AEE.out"
: ${MSGMERGE=msgmerge}
${MSGMERGE} -q -o mm-c-6-AEE.tmp \
--compendium "$abs_srcdir"/mm-ko-comp.euc-kr.po \
- "$abs_srcdir"/mm-ko.euc-kr.po "$abs_srcdir"/mm-ko.ascii.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-c-6-AEE.tmp > mm-c-6-AEE.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ "$abs_srcdir"/mm-ko.euc-kr.po "$abs_srcdir"/mm-ko.ascii.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-c-6-AEE.tmp > mm-c-6-AEE.out || exit 1
-tmpfiles="$tmpfiles mm-c-6-AEU.tmp mm-c-6-AEU.out"
: ${MSGMERGE=msgmerge}
${MSGMERGE} -q -o mm-c-6-AEU.tmp \
--compendium mm-ko-comp.utf-8.po \
- "$abs_srcdir"/mm-ko.euc-kr.po "$abs_srcdir"/mm-ko.ascii.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-c-6-AEU.tmp > mm-c-6-AEU.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ "$abs_srcdir"/mm-ko.euc-kr.po "$abs_srcdir"/mm-ko.ascii.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-c-6-AEU.tmp > mm-c-6-AEU.out || exit 1
-tmpfiles="$tmpfiles mm-c-6-AUE.tmp mm-c-6-AUE.out"
: ${MSGMERGE=msgmerge}
${MSGMERGE} -q -o mm-c-6-AUE.tmp \
--compendium "$abs_srcdir"/mm-ko-comp.euc-kr.po \
- mm-ko.utf-8.po "$abs_srcdir"/mm-ko.ascii.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-c-6-AUE.tmp > mm-c-6-AUE.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mm-ko.utf-8.po "$abs_srcdir"/mm-ko.ascii.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-c-6-AUE.tmp > mm-c-6-AUE.out || exit 1
-tmpfiles="$tmpfiles mm-c-6-AUU.tmp mm-c-6-AUU.out"
: ${MSGMERGE=msgmerge}
${MSGMERGE} -q -o mm-c-6-AUU.tmp \
--compendium mm-ko-comp.utf-8.po \
- mm-ko.utf-8.po "$abs_srcdir"/mm-ko.ascii.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-c-6-AUU.tmp > mm-c-6-AUU.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mm-ko.utf-8.po "$abs_srcdir"/mm-ko.ascii.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-c-6-AUU.tmp > mm-c-6-AUU.out || exit 1
-tmpfiles="$tmpfiles mm-c-6-UEE.tmp mm-c-6-UEE.out"
: ${MSGMERGE=msgmerge}
${MSGMERGE} -q -o mm-c-6-UEE.tmp \
--compendium "$abs_srcdir"/mm-ko-comp.euc-kr.po \
- "$abs_srcdir"/mm-ko.euc-kr.po mm-ko.utf-8.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-c-6-UEE.tmp > mm-c-6-UEE.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ "$abs_srcdir"/mm-ko.euc-kr.po mm-ko.utf-8.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-c-6-UEE.tmp > mm-c-6-UEE.out || exit 1
-tmpfiles="$tmpfiles mm-c-6-UEU.tmp mm-c-6-UEU.out"
: ${MSGMERGE=msgmerge}
${MSGMERGE} -q -o mm-c-6-UEU.tmp \
--compendium mm-ko-comp.utf-8.po \
- "$abs_srcdir"/mm-ko.euc-kr.po mm-ko.utf-8.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-c-6-UEU.tmp > mm-c-6-UEU.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ "$abs_srcdir"/mm-ko.euc-kr.po mm-ko.utf-8.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-c-6-UEU.tmp > mm-c-6-UEU.out || exit 1
-tmpfiles="$tmpfiles mm-c-6-UUE.tmp mm-c-6-UUE.out"
: ${MSGMERGE=msgmerge}
${MSGMERGE} -q -o mm-c-6-UUE.tmp \
--compendium "$abs_srcdir"/mm-ko-comp.euc-kr.po \
- mm-ko.utf-8.po mm-ko.utf-8.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-c-6-UUE.tmp > mm-c-6-UUE.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mm-ko.utf-8.po mm-ko.utf-8.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-c-6-UUE.tmp > mm-c-6-UUE.out || exit 1
-tmpfiles="$tmpfiles mm-c-6-UUU.tmp mm-c-6-UUU.out"
: ${MSGMERGE=msgmerge}
${MSGMERGE} -q -o mm-c-6-UUU.tmp \
--compendium mm-ko-comp.utf-8.po \
- mm-ko.utf-8.po mm-ko.utf-8.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-c-6-UUU.tmp > mm-c-6-UUU.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ mm-ko.utf-8.po mm-ko.utf-8.pot || exit 1
+LC_ALL=C tr -d '\r' < mm-c-6-UUU.tmp > mm-c-6-UUU.out || exit 1
-tmpfiles="$tmpfiles mm-c-6-U.ok mm-c-6-E.ok"
: ${MSGCONV=msgconv}
${MSGCONV} --to-code=UTF-8 mm-c-6-UUU.out | LC_ALL=C tr -d '\r' > mm-c-6-U.ok
${MSGCONV} --to-code=EUC-KR mm-c-6-UUU.out | sed -e 's,EUC-KR,euc-kr,' | LC_ALL=C tr -d '\r' > mm-c-6-E.ok
: ${DIFF=diff}
-${DIFF} mm-c-6-E.ok mm-c-6-AEE.out || { rm -fr $tmpfiles; exit 1; }
-${DIFF} mm-c-6-E.ok mm-c-6-AEU.out || { rm -fr $tmpfiles; exit 1; }
-${DIFF} mm-c-6-U.ok mm-c-6-AUE.out || { rm -fr $tmpfiles; exit 1; }
-${DIFF} mm-c-6-U.ok mm-c-6-AUU.out || { rm -fr $tmpfiles; exit 1; }
-${DIFF} mm-c-6-U.ok mm-c-6-UEE.out || { rm -fr $tmpfiles; exit 1; }
-${DIFF} mm-c-6-U.ok mm-c-6-UEU.out || { rm -fr $tmpfiles; exit 1; }
-${DIFF} mm-c-6-U.ok mm-c-6-UUE.out || { rm -fr $tmpfiles; exit 1; }
-${DIFF} mm-c-6-U.ok mm-c-6-UUU.out || { rm -fr $tmpfiles; exit 1; }
-
-rm -fr $tmpfiles
+${DIFF} mm-c-6-E.ok mm-c-6-AEE.out || { exit 1; }
+${DIFF} mm-c-6-E.ok mm-c-6-AEU.out || { exit 1; }
+${DIFF} mm-c-6-U.ok mm-c-6-AUE.out || { exit 1; }
+${DIFF} mm-c-6-U.ok mm-c-6-AUU.out || { exit 1; }
+${DIFF} mm-c-6-U.ok mm-c-6-UEE.out || { exit 1; }
+${DIFF} mm-c-6-U.ok mm-c-6-UEU.out || { exit 1; }
+${DIFF} mm-c-6-U.ok mm-c-6-UUE.out || { exit 1; }
+${DIFF} mm-c-6-U.ok mm-c-6-UUU.out || { exit 1; }
exit 0
# Test handling of obsolete/untranslated messages with Java .properties syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-p-1.in1 mm-p-1.in2"
cat <<EOF > mm-p-1.in1
#
# def.po
# trailing comments should be removed, even here
EOF
-tmpfiles="$tmpfiles mm-p-1.tmp mm-p-1.out"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q --properties-input --properties-output -o mm-p-1.tmp mm-p-1.in1 mm-p-1.in2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-p-1.tmp > mm-p-1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q --properties-input --properties-output -o mm-p-1.tmp mm-p-1.in1 mm-p-1.in2 || exit 1
+LC_ALL=C tr -d '\r' < mm-p-1.tmp > mm-p-1.out || exit 1
-tmpfiles="$tmpfiles mm-p-1.ok"
cat << EOF > mm-p-1.ok
#: file3:102
still\ existing=translation
${DIFF} mm-p-1.ok mm-p-1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --update: location changed, and xgettext comment added. Both changes
# must be reflected in the resulting PO file. With Java .properties syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-p-2.po"
cat <<\EOF > mm-p-2.po
#: cogarithmetic.cc:12
white=wei\u00df
EOF
-tmpfiles="$tmpfiles mm-p-2.pot"
cat <<EOF > mm-p-2.pot
#. location changed
#: cogarithmetic.cc:33
!white=
EOF
-tmpfiles="$tmpfiles mm-p-2.po~ mm-p-2.tmp"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q --properties-input --update mm-p-2.po mm-p-2.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-mv mm-p-2.po mm-p-2.tmp || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-p-2.tmp > mm-p-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q --properties-input --update mm-p-2.po mm-p-2.pot || exit 1
+mv mm-p-2.po mm-p-2.tmp || { exit 1; }
+LC_ALL=C tr -d '\r' < mm-p-2.tmp > mm-p-2.po || exit 1
-tmpfiles="$tmpfiles mm-p-2.ok"
cat <<\EOF > mm-p-2.ok
#. location changed
#: cogarithmetic.cc:33
${DIFF} mm-p-2.ok mm-p-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --update: nothing changed; don't normalize second message
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-u-1.po"
cat <<\EOF > mm-u-1.po
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
"schwarz"
EOF
-tmpfiles="$tmpfiles mm-u-1.pot"
cat <<EOF > mm-u-1.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-u-1.bak"
cp mm-u-1.po mm-u-1.bak
-tmpfiles="$tmpfiles mm-u-1.po~"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q --update mm-u-1.po mm-u-1.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q --update mm-u-1.po mm-u-1.pot || exit 1
: ${DIFF=diff}
${DIFF} mm-u-1.bak mm-u-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --update: location changed, and xgettext comment added. Both changes
# must be reflected in the resulting PO file.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-u-2.po"
cat <<\EOF > mm-u-2.po
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr "weiß"
EOF
-tmpfiles="$tmpfiles mm-u-2.pot"
cat <<EOF > mm-u-2.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-u-2.po~ mm-u-2.tmp"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q --update mm-u-2.po mm-u-2.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-mv mm-u-2.po mm-u-2.tmp || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mm-u-2.tmp > mm-u-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q --update mm-u-2.po mm-u-2.pot || exit 1
+mv mm-u-2.po mm-u-2.tmp || { exit 1; }
+LC_ALL=C tr -d '\r' < mm-u-2.tmp > mm-u-2.po || exit 1
-tmpfiles="$tmpfiles mm-u-2.ok"
cat <<\EOF > mm-u-2.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
${DIFF} mm-u-2.ok mm-u-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# in the resulting PO file; this is needed for projects which don't put the
# .pot file under CVS.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-u-3.po"
cat <<\EOF > mm-u-3.po
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr "weiß"
EOF
-tmpfiles="$tmpfiles mm-u-3.pot"
cat <<EOF > mm-u-3.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-u-3.po~"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q --update mm-u-3.po mm-u-3.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q --update mm-u-3.po mm-u-3.pot || exit 1
-tmpfiles="$tmpfiles mm-u-3.ok"
cat <<\EOF > mm-u-3.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
${DIFF} mm-u-3.ok mm-u-3.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# must not be reflected in the resulting PO file; this is needed for projects
# which don't put the .pot file under CVS.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mm-u-4.po"
cat <<\EOF > mm-u-4.po
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
#~ msgstr "grün"
EOF
-tmpfiles="$tmpfiles mm-u-4.pot"
cat <<EOF > mm-u-4.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
msgstr ""
EOF
-tmpfiles="$tmpfiles mm-u-4.po~"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q --update --sort-output mm-u-4.po mm-u-4.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q --update --sort-output mm-u-4.po mm-u-4.pot || exit 1
-tmpfiles="$tmpfiles mm-u-4.ok"
cat <<\EOF > mm-u-4.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
${DIFF} mm-u-4.ok mm-u-4.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of general operation.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mu-test1.in"
cat <<EOF > mu-test1.in
msgid "eight"
msgstr "eighth"
msgstr "second"
EOF
-tmpfiles="$tmpfiles mu-test1.mo"
: ${MSGFMT=msgfmt}
-${MSGFMT} -o mu-test1.mo mu-test1.in
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGFMT} -o mu-test1.mo mu-test1.in || exit 1
-tmpfiles="$tmpfiles mu-test1.tmp mu-test1.out"
: ${MSGUNFMT=msgunfmt}
-${MSGUNFMT} -o mu-test1.tmp mu-test1.mo
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mu-test1.tmp > mu-test1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNFMT} -o mu-test1.tmp mu-test1.mo || exit 1
+LC_ALL=C tr -d '\r' < mu-test1.tmp > mu-test1.out || exit 1
: ${DIFF=diff}
${DIFF} mu-test1.in mu-test1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# system-dependent strings), yields a PO file with c-format annotation, so that
# msgfmt applied to it will again produce a .mo file of major revision 1.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mu-2.in"
cat <<EOF > mu-2.in
#, c-format
msgid "truncating at %<PRIuMAX> bytes in output file %s"
msgstr "schneide bei %<PRIuMAX> Bytes in Ausgabedatei %s ab"
EOF
-tmpfiles="$tmpfiles mu-2.mo"
: ${MSGFMT=msgfmt}
-${MSGFMT} -o mu-2.mo mu-2.in
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGFMT} -o mu-2.mo mu-2.in || exit 1
-tmpfiles="$tmpfiles mu-2.tmp mu-2.out"
: ${MSGUNFMT=msgunfmt}
-${MSGUNFMT} -o mu-2.tmp mu-2.mo
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mu-2.tmp > mu-2.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNFMT} -o mu-2.tmp mu-2.mo || exit 1
+LC_ALL=C tr -d '\r' < mu-2.tmp > mu-2.out || exit 1
: ${DIFF=diff}
${DIFF} mu-2.in mu-2.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of --csharp option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# Test whether we can compile and execute C# programs.
test "${CSHARP_CHOICE}" != no || {
echo "Skipping test: configured with --disable-csharp"
exit 77
}
-tmpfiles="$tmpfiles mu-cs-1"
test -d mu-cs-1 || mkdir mu-cs-1
cat <<\EOF > mu-cs-1/fr.po
: ${DIFF=diff}
${DIFF} mu-cs-1/prog.ok mu-cs-1/prog.sort || exit 1
-rm -fr $tmpfiles
-
exit 0
# Note: This test fails when using gcj from GCC 3.1 and GCC 3.2, due to a bug
# (libgcj/6576). It is fixed in GCC 3.3.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# Test whether we can compile and execute Java programs.
test "${JAVA_CHOICE}" != no || {
echo "Skipping test: configured with --disable-java"
exit 77
}
-tmpfiles="$tmpfiles mu-java-1"
test -d mu-java-1 || mkdir mu-java-1
cat <<\EOF > mu-java-1/fr.po
: ${DIFF=diff}
${DIFF} mu-java-1/prog.ok mu-java-1/prog.sort || exit 1
-rm -fr $tmpfiles
-
exit 0
# Test of general operation with Java .properties syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles mu-p-1.in"
cat <<EOF > mu-p-1.in
eight=eighth
two=second
EOF
-tmpfiles="$tmpfiles mu-p-1.mo"
: ${MSGFMT=msgfmt}
-${MSGFMT} --properties-input -o mu-p-1.mo mu-p-1.in
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGFMT} --properties-input -o mu-p-1.mo mu-p-1.in || exit 1
-tmpfiles="$tmpfiles mu-p-1.tmp mu-p-1.out"
: ${MSGUNFMT=msgunfmt}
-${MSGUNFMT} --properties-output -o mu-p-1.tmp mu-p-1.mo
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < mu-p-1.tmp > mu-p-1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNFMT} --properties-output -o mu-p-1.tmp mu-p-1.mo || exit 1
+LC_ALL=C tr -d '\r' < mu-p-1.tmp > mu-p-1.out || exit 1
: ${DIFF=diff}
${DIFF} mu-p-1.in mu-p-1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# reads empty output, and refrains from creating a PO file because
# --force-po was not specified.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# Test whether we can execute Tcl programs and Tcl's fconfigure command
# understands the -encoding option (it does since approximately Tcl 8.1).
-tmpfiles="$tmpfiles mu-tcl-1-version.tcl"
cat <<\EOF > mu-tcl-1-version.tcl
fconfigure stdout -encoding utf-8
puts $tcl_version
EOF
(tclsh mu-tcl-1-version.tcl) >/dev/null 2>/dev/null \
|| { echo "Skipping test: tclsh not found or Tcl too old"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles mu-tcl-1-fr.po"
cat <<\EOF > mu-tcl-1-fr.po
msgid ""
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
msgstr "%2$s remplace %1$s."
EOF
-tmpfiles="$tmpfiles mu-tcl-1-msgs"
test -d mu-tcl-1-msgs || mkdir mu-tcl-1-msgs
: ${MSGFMT=msgfmt}
${MSGFMT} --tcl -d mu-tcl-1-msgs -l fr mu-tcl-1-fr.po || exit 1
-tmpfiles="$tmpfiles mu-tcl-1-prog.out"
: ${MSGUNFMT=msgunfmt}
GETTEXTDATADIR="$abs_top_srcdir"/src \
${MSGUNFMT} --tcl -d mu-tcl-1-msgs -l fr -o mu-tcl-1-prog.out || exit 1
-tmpfiles="$tmpfiles mu-tcl-1-prog.ok"
cat <<\EOF > mu-tcl-1-prog.ok
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8\n"
: ${DIFF=diff}
${DIFF} mu-tcl-1-prog.ok mu-tcl-1-prog.out || exit 1
-rm -fr $tmpfiles
-
exit 0
# Test general operation.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles msguniq-1.tmp msguniq-1.out"
: ${MSGUNIQ-msguniq}
-${MSGUNIQ} -w 1000 -o msguniq-1.tmp "$abs_srcdir"/msguniq-a.in
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < msguniq-1.tmp > msguniq-1.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNIQ} -w 1000 -o msguniq-1.tmp "$abs_srcdir"/msguniq-a.in || exit 1
+LC_ALL=C tr -d '\r' < msguniq-1.tmp > msguniq-1.out || exit 1
: ${DIFF=diff}
${DIFF} "$abs_srcdir"/msguniq-a.out msguniq-1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --unique option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles msguniq-2.tmp msguniq-2.out"
: ${MSGUNIQ-msguniq}
-${MSGUNIQ} -w 1000 -u -o msguniq-2.tmp "$abs_srcdir"/msguniq-a.in
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < msguniq-2.tmp > msguniq-2.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNIQ} -w 1000 -u -o msguniq-2.tmp "$abs_srcdir"/msguniq-a.in || exit 1
+LC_ALL=C tr -d '\r' < msguniq-2.tmp > msguniq-2.out || exit 1
-tmpfiles="$tmpfiles msguniq-2.ok"
cat <<\EOF > msguniq-2.ok
# Template messages for CLISP
# Copyright (C) 1992-2001 Bruno Haible, Michael Stoll, Marcus Daniels
${DIFF} msguniq-2.ok msguniq-2.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --repeated option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles msguniq-3.tmp msguniq-3.out"
: ${MSGUNIQ-msguniq}
-${MSGUNIQ} -w 1000 -d -o msguniq-3.tmp "$abs_srcdir"/msguniq-a.in
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < msguniq-3.tmp > msguniq-3.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNIQ} -w 1000 -d -o msguniq-3.tmp "$abs_srcdir"/msguniq-a.in || exit 1
+LC_ALL=C tr -d '\r' < msguniq-3.tmp > msguniq-3.out || exit 1
-tmpfiles="$tmpfiles msguniq-3.ok"
cat <<\EOF > msguniq-3.ok
# Template messages for CLISP
# Copyright (C) 1992-2001 Bruno Haible, Michael Stoll, Marcus Daniels
${DIFF} msguniq-3.ok msguniq-3.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test general operation with Java .properties syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles msguniq-4.out"
: ${MSGUNIQ-msguniq}
-${MSGUNIQ} --properties-input --properties-output -w 1000 -o msguniq-4.out "$abs_srcdir"/msguniq-a.inp
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNIQ} --properties-input --properties-output -w 1000 -o msguniq-4.out "$abs_srcdir"/msguniq-a.inp || exit 1
-tmpfiles="$tmpfiles msguniq-4.ok"
: ${MSGCAT-msgcat}
-${MSGCAT} --properties-output -w 1000 -o msguniq-4.ok "$abs_srcdir"/msguniq-a.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGCAT} --properties-output -w 1000 -o msguniq-4.ok "$abs_srcdir"/msguniq-a.out || exit 1
: ${DIFF=diff}
${DIFF} msguniq-4.ok msguniq-4.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msguniq on a PO file with contexts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles msguniq-5.po"
cat <<\EOF > msguniq-5.po
msgid ""
msgstr ""
#~ msgstr "Enregistrer sous"
EOF
-tmpfiles="$tmpfiles msguniq-5.tmp msguniq-5.out"
: ${MSGUNIQ-msguniq}
-${MSGUNIQ} -o msguniq-5.tmp msguniq-5.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < msguniq-5.tmp > msguniq-5.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNIQ} -o msguniq-5.tmp msguniq-5.po || exit 1
+LC_ALL=C tr -d '\r' < msguniq-5.tmp > msguniq-5.out || exit 1
-tmpfiles="$tmpfiles msguniq-5.ok"
cat <<\EOF > msguniq-5.ok
msgid ""
msgstr ""
${DIFF} msguniq-5.ok msguniq-5.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test msguniq on PO file with previous msgids.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles msguniq-6.in"
cat <<\EOF > msguniq-6.in
msgid ""
msgstr ""
msgstr "%s: Option erwartet ein Argument -- %c\n"
EOF
-tmpfiles="$tmpfiles msguniq-6.tmp msguniq-6.out"
: ${MSGUNIQ=msguniq}
-${MSGUNIQ} -o msguniq-6.tmp msguniq-6.in
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < msguniq-6.tmp > msguniq-6.out
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNIQ} -o msguniq-6.tmp msguniq-6.in || exit 1
+LC_ALL=C tr -d '\r' < msguniq-6.tmp > msguniq-6.out || exit 1
-tmpfiles="$tmpfiles msguniq-6.ok"
cat <<\EOF > msguniq-6.ok
msgid ""
msgstr ""
${DIFF} msguniq-6.ok msguniq-6.out
result=$?
-rm -fr $tmpfiles
-
exit $result
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles plural-1-cake.tmp plural-1-cake.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o plural-1-cake.tmp --omit-header --no-location "$abs_srcdir"/plural-1-prg.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < plural-1-cake.tmp > plural-1-cake.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o plural-1-cake.tmp --omit-header --no-location "$abs_srcdir"/plural-1-prg.c || exit 1
+LC_ALL=C tr -d '\r' < plural-1-cake.tmp > plural-1-cake.pot || exit 1
-tmpfiles="$tmpfiles plural-1-cake.ok"
cat <<EOF > plural-1-cake.ok
#, c-format
msgid "a piece of cake"
: ${DIFF=diff}
${DIFF} plural-1-cake.ok plural-1-cake.pot || exit 1
-tmpfiles="$tmpfiles plural-1-fr.po"
cat <<EOF > plural-1-fr.po
# Les gateaux allemands sont les meilleurs du monde.
#, c-format
msgstr[1] "%d morceaux de gateau"
EOF
-tmpfiles="$tmpfiles plural-1-fr.po.tmp plural-1-fr.po.new"
: ${MSGMERGE=msgmerge}
-${MSGMERGE} -q -o plural-1-fr.po.tmp plural-1-fr.po plural-1-cake.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < plural-1-fr.po.tmp > plural-1-fr.po.new
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGMERGE} -q -o plural-1-fr.po.tmp plural-1-fr.po plural-1-cake.pot || exit 1
+LC_ALL=C tr -d '\r' < plural-1-fr.po.tmp > plural-1-fr.po.new || exit 1
: ${DIFF=diff}
${DIFF} plural-1-fr.po plural-1-fr.po.new || exit 1
-tmpfiles="$tmpfiles plural-1-dir"
test -d plural-1-dir || mkdir plural-1-dir
test -d plural-1-dir/fr || mkdir plural-1-dir/fr
test -d plural-1-dir/fr/LC_MESSAGES || mkdir plural-1-dir/fr/LC_MESSAGES
: ${MSGFMT=msgfmt}
${MSGFMT} -o plural-1-dir/fr/LC_MESSAGES/cake.mo plural-1-fr.po
-tmpfiles="$tmpfiles plural-1-fr.po.tmp plural-1-fr.po.un"
: ${MSGUNFMT=msgunfmt}
-${MSGUNFMT} -o plural-1-fr.po.tmp plural-1-dir/fr/LC_MESSAGES/cake.mo
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < plural-1-fr.po.tmp > plural-1-fr.po.un
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${MSGUNFMT} -o plural-1-fr.po.tmp plural-1-dir/fr/LC_MESSAGES/cake.mo || exit 1
+LC_ALL=C tr -d '\r' < plural-1-fr.po.tmp > plural-1-fr.po.un || exit 1
-tmpfiles="$tmpfiles plural-1-fr.po.strip"
sed 1,2d < plural-1-fr.po > plural-1-fr.po.strip
: ${DIFF=diff}
${DIFF} plural-1-fr.po.strip plural-1-fr.po.un || exit 1
-tmpfiles="$tmpfiles plural-1-cake.ok plural-1-cake.tmp cake.out"
: ${DIFF=diff}
echo 'un morceau de gateau' > plural-1-cake.ok
LANGUAGE= ../cake fr 1 > plural-1-cake.tmp || exit 1
LC_ALL=C tr -d '\r' < plural-1-cake.tmp > cake.out || exit 1
${DIFF} plural-1-cake.ok cake.out || exit 1
-rm -fr $tmpfiles
-
exit 0
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles plural-2-dir plural-2-ll.po dataout"
: ${MSGFMT=msgfmt}
test -d plural-2-dir || mkdir plural-2-dir
test -d plural-2-dir/ll || mkdir plural-2-dir/ll
test -d plural-2-dir/ll/LC_MESSAGES || mkdir plural-2-dir/ll/LC_MESSAGES
-tmpfiles="$tmpfiles plural-2.data"
cat <<EOF > plural-2.data
ja
0
echo "plural=${formula}" 1>&2
echo "Expected: $dataok" 1>&2
echo "Got: "`cat dataout` 1>&2
- rm -fr $tmpfiles
exit 1
}
done < plural-2.data
-rm -fr $tmpfiles
-
exit 0
# Test recode-sr-latin on some input in UTF-8 encoding.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# Test whether a specific UTF-8 locale is installed.
: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
if test $LOCALE_FR_UTF8 != none; then
else
echo "Skipping test: no french UTF-8 locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-tmpfiles="$tmpfiles rec-srl-1.in"
cat <<\EOF > rec-srl-1.in
Исправни аргументи су
неједнозначан аргумент
ѐѝӣӯ ЍЀӢӮ ЉӮ ӮЉ
EOF
-tmpfiles="$tmpfiles rec-srl-1.out"
: ${RECODE=recode}
LC_ALL=$LOCALE_FR_UTF8 \
${RECODE}-sr-latin < rec-srl-1.in > rec-srl-1.out \
- || { rm -fr $tmpfiles; exit 1; }
+ || { exit 1; }
-tmpfiles="$tmpfiles rec-srl-1.ok"
cat <<\EOF > rec-srl-1.ok
Ispravni argumenti su
nejednoznačan argument
${DIFF} rec-srl-1.ok rec-srl-1.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Note: This test fails on AIX 4 with libiconv < 1.12, due to an interaction
# between libiconv and the setlocale() function. It is fixed in libiconv-1.12.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
# Test whether a specific EUC-JP locale is installed.
: ${LOCALE_JA=ja_JP}
if test $LOCALE_JA = none; then
else
echo "Skipping test: no japanese EUC-JP locale is supported"
fi
- rm -fr $tmpfiles; exit 77
+ exit 77
fi
-tmpfiles="$tmpfiles rec-srl-2.in"
cat <<\EOF > rec-srl-2.in
§ª§ã§á§â§Ñ§Ó§ß§Ú §Ñ§â§Ô§å§Þ§Ö§ß§ä§Ú §ã§å
§ß§Ö\8f§ø§Ö§Õ§ß§à§Ù§ß§Ñ§é§Ñ§ß §Ñ§â§Ô§å§Þ§Ö§ß§ä
EOF
-tmpfiles="$tmpfiles rec-srl-2.out"
: ${RECODE=recode}
LC_ALL=$LOCALE_JA \
${RECODE}-sr-latin < rec-srl-2.in > rec-srl-2.out \
- || { rm -fr $tmpfiles; exit 1; }
+ || { exit 1; }
-tmpfiles="$tmpfiles rec-srl-2.ok"
cat <<\EOF > rec-srl-2.ok
Ispravni argumenti su
nejednozna\8f«an argument
${DIFF} rec-srl-2.ok rec-srl-2.out
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test -x option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles zero-domain.po xg-test1.err"
rm -f zero-domain.po
: ${XGETTEXT=xgettext}
LC_MESSAGES=C LC_ALL= \
"$abs_top_srcdir"/src/xgettext.c >xg-test1.err 2>&1
result=$?
cat xg-test1.err | grep -v 'warning: Charset' | grep -v '^ '
-test $result = 0 || { rm -fr $tmpfiles; exit 1; }
+test $result = 0 || { exit 1; }
test ! -f zero-domain.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Even an empty string is extracted, if not overridden by xgettext's
# default-constructed header entry.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-test2.in.c"
cat <<EOF > xg-test2.in.c
This is a test of the xgettext functionality.
/* xgettext:no-c-format */
_("")
EOF
-tmpfiles="$tmpfiles xg-test2.tmp.po xg-test2.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -d xg-test2.tmp -k_ --omit-header --no-location xg-test2.in.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-test2.tmp.po > xg-test2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -d xg-test2.tmp -k_ --omit-header --no-location xg-test2.in.c || exit 1
+LC_ALL=C tr -d '\r' < xg-test2.tmp.po > xg-test2.po || exit 1
-tmpfiles="$tmpfiles xg-test2.ok"
cat <<EOF > xg-test2.ok
#, no-c-format
msgid "extract me"
${DIFF} xg-test2.ok xg-test2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# When a header entry is provided by xgettext, it overrides any msgid ""
# present in the input.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-test3.in.c"
cat <<EOF > xg-test3.in.c
This is a test of the xgettext functionality.
/* xgettext:no-c-format */
_("")
EOF
-tmpfiles="$tmpfiles xg-test3.po"
: ${XGETTEXT=xgettext}
# delete POT-Creation-Date: line because the date depends on local time.
${XGETTEXT} --output - --no-location -k_ xg-test3.in.c 2>/dev/null \
| sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-test3.po
-tmpfiles="$tmpfiles xg-test3.ok"
cat <<EOF > xg-test3.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-test3.ok xg-test3.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test --foreign-user
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-test4.in.c"
cat <<EOF > xg-test4.in.c
_("extract me")
EOF
-tmpfiles="$tmpfiles xg-test4.po"
: ${XGETTEXT=xgettext}
# delete POT-Creation-Date: line because the date depends on local time.
${XGETTEXT} --output - --foreign-user --no-location -k_ xg-test4.in.c \
| sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-test4.po
-tmpfiles="$tmpfiles xg-test4.ok"
cat <<EOF > xg-test4.ok
# SOME DESCRIPTIVE TITLE.
# This file is put in the public domain.
${DIFF} xg-test4.ok xg-test4.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test extraction of non-ASCII msgids.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-test5.c"
cat <<EOF > xg-test5.c
void foo (int option)
{
}
EOF
-tmpfiles="$tmpfiles xg-test5.tmp xg-test5.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --no-location -k_ -o xg-test5.po xg-test5.c 2>/dev/null
-test $? = 1 || { rm -fr $tmpfiles; exit 1; }
-${XGETTEXT} --no-location -k_ --from-code=iso-8859-2 -o xg-test5.tmp xg-test5.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-test5.tmp > xg-test5.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $? = 1 || { exit 1; }
+${XGETTEXT} --no-location -k_ --from-code=iso-8859-2 -o xg-test5.tmp xg-test5.c || exit 1
+LC_ALL=C tr -d '\r' < xg-test5.tmp > xg-test5.po || exit 1
-tmpfiles="$tmpfiles xg-test5.pot"
sed -e '/POT-Creation-Date/d' < xg-test5.po > xg-test5.pot
-tmpfiles="$tmpfiles xg-test5.ok"
cat <<EOF > xg-test5.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-test5.ok xg-test5.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of position dependent recognition of format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-test6.c"
cat <<\EOF > xg-test6.c
fprintf (fp, gettext ("c-format positive1"), gettext ("c-format negative1"));
printk (gettext ("c-format negative2"));
EOF
-tmpfiles="$tmpfiles xg-test6.sh"
cat <<\EOF > xg-test6.sh
eval_gettext "sh-format positive1" "`gettext \"sh-format negative1\"`"
echo "`gettext \"sh-format negative2\"`"
EOF
-tmpfiles="$tmpfiles xg-test6.py"
cat <<\EOF > xg-test6.py
my_printf (gettext ("python-format positive1"),
gettext ("python-format negative1"));
printk (gettext ("python-format negative2"));
EOF
-tmpfiles="$tmpfiles xg-test6.lisp"
cat <<\EOF > xg-test6.lisp
(format t (gettext "lisp-format positive1") (gettext "lisp-format negative1"))
(prin1 (gettext "lisp-format negative2"))
EOF
-tmpfiles="$tmpfiles xg-test6.el"
cat <<\EOF > xg-test6.el
(format (_ "elisp-format positive1") (_ "elisp-format negative1"))
(printk (_ "elisp-format negative2"))
EOF
-tmpfiles="$tmpfiles xg-test6.jl"
cat <<\EOF > xg-test6.jl
(format stream (_ "librep-format positive1") (_ "librep-format negative1"))
(printk (_ "librep-format negative2"))
EOF
-tmpfiles="$tmpfiles xg-test6.java"
cat <<\EOF > xg-test6.java
MessageFormat.format(gettext("java-format positive1"),
gettext("java-format negative1"));
System.err.println(gettext("java-format negative2"));
EOF
-tmpfiles="$tmpfiles xg-test6.awk"
cat <<\EOF > xg-test6.awk
printf dcgettext ("awk-format positive1"), dcgettext ("awk-format negative1");
printf (dcgettext ("awk-format positive2"), dcgettext ("awk-format negative2"));
printk dcgettext ("awk-format negative4");
EOF
-tmpfiles="$tmpfiles xg-test6.ycp"
cat <<\EOF > xg-test6.ycp
sformat (_("ycp-format positive1"), _("ycp-format negative1"));
printk (_("ycp-format negative2"));
EOF
-tmpfiles="$tmpfiles xg-test6.tcl"
cat <<\EOF > xg-test6.tcl
[format [::msgcat::mc "tcl-format positive1"]
[::msgcat::mc "tcl-format negative1"]]
[print [::msgcat::mc "tcl-format negative2"]]
EOF
-tmpfiles="$tmpfiles xg-test6.pl"
cat <<\EOF > xg-test6.pl
printf gettext "perl-format positive1", gettext ("perl-format negative1");
gettext ("perl-format negative2");
print kprintf gettext "perl-format negative5";
EOF
-tmpfiles="$tmpfiles xg-test6.php"
cat <<\EOF > xg-test6.php
<? php
printf (_ ("php-format positive1"), _ ("php-format negative1"));
printk (_ ("php-format negative2"));
EOF
-tmpfiles="$tmpfiles xg-test6.tmp.po xg-test6.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location -d xg-test6.tmp \
--flag=my_printf:1:python-format \
xg-test6.c xg-test6.sh xg-test6.py xg-test6.lisp xg-test6.el \
xg-test6.jl xg-test6.java xg-test6.awk xg-test6.ycp xg-test6.tcl \
- xg-test6.pl xg-test6.php
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-test6.tmp.po > xg-test6.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ xg-test6.pl xg-test6.php || exit 1
+LC_ALL=C tr -d '\r' < xg-test6.tmp.po > xg-test6.po || exit 1
-tmpfiles="$tmpfiles xg-test6.ok"
cat <<\EOF > xg-test6.ok
#, c-format
msgid "c-format positive1"
${DIFF} xg-test6.ok xg-test6.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of comment extraction in the case of duplicated msgids.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-test7.c"
cat <<\EOF > xg-test7.c
/* first comment */
/* xgettext: c-format */
gettext ("abc");
EOF
-tmpfiles="$tmpfiles xg-test7.tmp.po xg-test7.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --add-comments -d xg-test7.tmp xg-test7.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-test7.tmp.po > xg-test7.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --add-comments -d xg-test7.tmp xg-test7.c || exit 1
+LC_ALL=C tr -d '\r' < xg-test7.tmp.po > xg-test7.po || exit 1
-tmpfiles="$tmpfiles xg-test7.ok"
cat <<\EOF > xg-test7.ok
#. first comment
#. second comment
${DIFF} xg-test7.ok xg-test7.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test -j option with charset conversion from ISO-8859-1 to UTF-8.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-test8.po"
cat <<\EOF > xg-test8.po
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
msgstr "ö"
EOF
-tmpfiles="$tmpfiles xg-test8.in.c"
cat <<EOF > xg-test8.in.c
_("extract me")
EOF
: ${XGETTEXT=xgettext}
-${XGETTEXT} -a -j -o xg-test8.po xg-test8.in.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -a -j -o xg-test8.po xg-test8.in.c || exit 1
-tmpfiles="$tmpfiles xg-test8.pot"
sed -e '/POT-Creation-Date/d' < xg-test8.po | LC_ALL=C tr -d '\r' > xg-test8.pot
-tmpfiles="$tmpfiles xg-test8.ok"
cat <<\EOF > xg-test8.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-test8.ok xg-test8.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of extracted comments specified per keyword, including the case of
# duplicated msgids.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-test9.c"
cat <<\EOF > xg-test9.c
/* xgettext: max-width 25 */
label ("eagle");
label ("pigeon");
EOF
-tmpfiles="$tmpfiles xg-test9.tmp.po xg-test9.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header \
--keyword=label:1,\"xhtml-format\",\"xml-format\" \
--keyword=title:1,\"xhtml-format\",\"xml-format\" \
- -d xg-test9.tmp xg-test9.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-test9.tmp.po > xg-test9.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-test9.tmp xg-test9.c || exit 1
+LC_ALL=C tr -d '\r' < xg-test9.tmp.po > xg-test9.po || exit 1
-tmpfiles="$tmpfiles xg-test9.ok"
cat <<\EOF > xg-test9.ok
#. xhtml-format
#. xml-format
${DIFF} xg-test9.ok xg-test9.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test awk support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-a-1.awk"
cat <<EOF > xg-a-1.awk
# This comment will not be extracted.
print _"help"
print _"The Fabulous Four"
EOF
-tmpfiles="$tmpfiles xg-a-1.tmp.po xg-a-1.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-a-1.tmp xg-a-1.awk
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-a-1.tmp.po > xg-a-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-a-1.tmp xg-a-1.awk || exit 1
+LC_ALL=C tr -d '\r' < xg-a-1.tmp.po > xg-a-1.po || exit 1
-tmpfiles="$tmpfiles xg-a-1.ok"
cat <<EOF > xg-a-1.ok
msgid "help"
msgstr ""
${DIFF} xg-a-1.ok xg-a-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test awk support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-a-2.awk"
cat <<\EOF > xg-a-2.awk
# a
string = # b
;
EOF
-tmpfiles="$tmpfiles xg-a-2.tmp.po xg-a-2.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
- -d xg-a-2.tmp xg-a-2.awk
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-a-2.tmp.po > xg-a-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-a-2.tmp xg-a-2.awk || exit 1
+LC_ALL=C tr -d '\r' < xg-a-2.tmp.po > xg-a-2.po || exit 1
-tmpfiles="$tmpfiles xg-a-2.ok"
cat <<EOF > xg-a-2.ok
#. a
#. b
${DIFF} xg-a-2.ok xg-a-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# 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 \
- "$abs_top_srcdir"/src/xgettext.c "$abs_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} "$abs_srcdir"/xg-c-1.ok.po xg-c-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C support: extraction of contexts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-10.c"
cat <<\EOF > xg-c-10.c
// (KDE) The 1-argument i18n macro is a simple gettext without context.
print (i18n ("help"));
print (tr ("open", "File"));
EOF
-tmpfiles="$tmpfiles xg-c-10.tmp.po xg-c-10.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location \
--keyword=i18n:1 --keyword=i18n:1c,2 --keyword=tr:1 --keyword=tr:1,2c \
- -d xg-c-10.tmp xg-c-10.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-10.tmp.po > xg-c-10.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-c-10.tmp xg-c-10.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-10.tmp.po > xg-c-10.po || exit 1
-tmpfiles="$tmpfiles xg-c-10.ok"
cat <<EOF > xg-c-10.ok
msgid "help"
msgstr ""
${DIFF} xg-c-10.ok xg-c-10.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C support: extraction of contexts, disambiguating according to the
# argument count.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-11.c"
cat <<\EOF > xg-c-11.c
// (KDE) The 1-argument i18n macro is a simple gettext without context.
print (i18n ("help"));
print (i18n ("error", "errors", 7));
EOF
-tmpfiles="$tmpfiles xg-c-11.tmp.po xg-c-11.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location \
--keyword=i18n:1 --keyword=i18n:1c,2,2t --keyword=i18n:1,2,3t \
- -d xg-c-11.tmp xg-c-11.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-11.tmp.po > xg-c-11.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-c-11.tmp xg-c-11.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-11.tmp.po > xg-c-11.po || exit 1
-tmpfiles="$tmpfiles xg-c-11.ok"
cat <<EOF > xg-c-11.ok
msgid "help"
msgstr ""
${DIFF} xg-c-11.ok xg-c-11.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C support: valid but unlikely C format strings are _not_ marked as
# c-format by default.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-12.c"
cat <<\EOF > xg-c-12.c
gettext ("%1% on, %2% off");
EOF
-tmpfiles="$tmpfiles xg-c-12.tmp.po xg-c-12.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -d xg-c-12.tmp xg-c-12.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-12.tmp.po > xg-c-12.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -d xg-c-12.tmp xg-c-12.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-12.tmp.po > xg-c-12.po || exit 1
-tmpfiles="$tmpfiles xg-c-12.ok"
cat <<EOF > xg-c-12.ok
msgid "%1% on, %2% off"
msgstr ""
${DIFF} xg-c-12.ok xg-c-12.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C++ support: test --flag that introduces qt-format.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-13.cc"
cat <<\EOF > xg-c-13.cc
foo (gettext ("on"));
tr ("stopped");
tr ("deleted %n files", "", numdel);
EOF
-tmpfiles="$tmpfiles xg-c-13.tmp.po xg-c-13.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location -d xg-c-13.tmp \
--qt \
--flag=foo:1:qt-format --flag=gettext:1:pass-qt-format \
--keyword=tr:1,1t --keyword=tr:1,2c,2t --keyword=tr:1,1,2c,3t \
- xg-c-13.cc
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-13.tmp.po > xg-c-13.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ xg-c-13.cc || exit 1
+LC_ALL=C tr -d '\r' < xg-c-13.tmp.po > xg-c-13.po || exit 1
-tmpfiles="$tmpfiles xg-c-13.ok"
cat <<EOF > xg-c-13.ok
#, qt-format
msgid "on"
${DIFF} xg-c-13.ok xg-c-13.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C++ support: test boost-format.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-14.cc"
cat <<\EOF > xg-c-14.cc
// These are recognized as boost-format because of the keyword 'format'.
format(gettext("%s on, %s off"));
gettext("heuristic %1% on, %2% off");
EOF
-tmpfiles="$tmpfiles xg-c-14.tmp.po xg-c-14.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -d xg-c-14.tmp --boost xg-c-14.cc
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-14.tmp.po > xg-c-14.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -d xg-c-14.tmp --boost xg-c-14.cc || exit 1
+LC_ALL=C tr -d '\r' < xg-c-14.tmp.po > xg-c-14.po || exit 1
# The first 4 are not marked as c-format, because they are known as
# boost-format. The last 4 are governed by the heuristic. The first two
# among them are valid c-format strings. The last one is a valid but unlikely
# c-format string, therefore the heuristic doesn't mark it.
-tmpfiles="$tmpfiles xg-c-14.ok"
cat <<\EOF > xg-c-14.ok
#, boost-format
msgid "%s on, %s off"
${DIFF} xg-c-14.ok xg-c-14.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C support: extraction of contexts specified in GNOME glib syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-15.c"
cat <<\EOF > xg-c-15.c
/* (glib) The 1-argument Q_ macro is a gettext with context. */
print (Q_ ("Printer|Open"));
print (Q_ ("Menu|Recent File", "Menu|Recent Files"));
EOF
-tmpfiles="$tmpfiles xg-c-15.tmp.po xg-c-15.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location \
--keyword=Q_:1g --keyword=Q_:1g,2g \
- -d xg-c-15.tmp xg-c-15.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-15.tmp.po > xg-c-15.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-c-15.tmp xg-c-15.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-15.tmp.po > xg-c-15.po || exit 1
-tmpfiles="$tmpfiles xg-c-15.ok"
cat <<EOF > xg-c-15.ok
msgctxt "Printer"
msgid "Open"
${DIFF} xg-c-15.ok xg-c-15.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-16.c"
cat <<\EOF > xg-c-16.c
/* a */
/* b */ char *string = /* c */
/* e */ _( /* f */ "hello " /* g */ "world" /* h */ );
EOF
-tmpfiles="$tmpfiles xg-c-16.tmp.po xg-c-16.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
- -d xg-c-16.tmp xg-c-16.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-16.tmp.po > xg-c-16.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-c-16.tmp xg-c-16.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-16.tmp.po > xg-c-16.po || exit 1
-tmpfiles="$tmpfiles xg-c-16.ok"
cat <<EOF > xg-c-16.ok
#. a
#. b
${DIFF} xg-c-16.ok xg-c-16.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C++ support: test kde-format and format recognition heuristics.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-17.cc"
cat <<\EOF > xg-c-17.cc
/* When xgettext has no info, it flags both c-format and kde-format, based
on the heuristics. */
gettext ("remaining time: %1m %2s");
EOF
-tmpfiles="$tmpfiles xg-c-17.tmp.po xg-c-17.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location -d xg-c-17.tmp --language=C++ --kde \
- xg-c-17.cc
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-17.tmp.po > xg-c-17.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ xg-c-17.cc || exit 1
+LC_ALL=C tr -d '\r' < xg-c-17.tmp.po > xg-c-17.po || exit 1
-tmpfiles="$tmpfiles xg-c-17.ok"
cat <<EOF > xg-c-17.ok
#, c-format, kde-format
msgid "used time: %1m %2s"
${DIFF} xg-c-17.ok xg-c-17.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C support: extraction of 'range:' flags.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-18.c"
cat <<\EOF > xg-c-18.c
if (days > 7 && days < 14)
/* xgettext: range: 1..6 */
days - 7);
EOF
-tmpfiles="$tmpfiles xg-c-18.tmp.po xg-c-18.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -d xg-c-18.tmp xg-c-18.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-18.tmp.po > xg-c-18.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -d xg-c-18.tmp xg-c-18.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-18.tmp.po > xg-c-18.po || exit 1
-tmpfiles="$tmpfiles xg-c-18.ok"
cat <<EOF > xg-c-18.ok
#, c-format, range: 1..6
msgid "one week and one day"
${DIFF} xg-c-18.ok xg-c-18.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C support: comments meant for xgettext, and whitespace.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-2.in.c"
cat <<EOF > xg-c-2.in.c
This is a test of the xgettext functionality.
/* xgettext:no-c-format */
)
EOF
-tmpfiles="$tmpfiles xg-c-2.tmp.po xg-c-2.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -d xg-c-2.tmp -k_ --omit-header --no-location xg-c-2.in.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-2.tmp.po > xg-c-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -d xg-c-2.tmp -k_ --omit-header --no-location xg-c-2.in.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-2.tmp.po > xg-c-2.po || exit 1
-tmpfiles="$tmpfiles xg-c-2.ok"
cat <<EOF > xg-c-2.ok
#, no-c-format
msgid "extract me"
${DIFF} xg-c-2.ok xg-c-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C support: recognition of #line.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-3.in.c"
cat <<EOF > xg-c-3.in.c
#line 42 "bozo"
main(){printf(gettext("Hello, World!\n"));}
gettext("nothing");
EOF
-tmpfiles="$tmpfiles xg-c-3.tmp.po xg-c-3.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --add-location -d xg-c-3.tmp xg-c-3.in.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-3.tmp.po > xg-c-3.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --add-location -d xg-c-3.tmp xg-c-3.in.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-3.tmp.po > xg-c-3.po || exit 1
-tmpfiles="$tmpfiles xg-c-3.ok"
cat <<EOF > xg-c-3.ok
#: bozo:42
#, c-format
${DIFF} xg-c-3.ok xg-c-3.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# 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")); ??>
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"
${DIFF} xg-c-4.ok xg-c-4.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C support: comments.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-5.in.cc"
cat <<EOF > xg-c-5.in.cc
main(){printf(gettext/*puke*/(/*barf*/"Hello, " "World!" "\n")); }
EOF
-tmpfiles="$tmpfiles xg-c-5.tmp.po xg-c-5.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location --add-comments -d xg-c-5.tmp xg-c-5.in.cc
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-5.tmp.po > xg-c-5.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location --add-comments -d xg-c-5.tmp xg-c-5.in.cc || exit 1
+LC_ALL=C tr -d '\r' < xg-c-5.tmp.po > xg-c-5.po || exit 1
-tmpfiles="$tmpfiles xg-c-5.ok"
cat <<EOF > xg-c-5.ok
#. puke
#. barf
${DIFF} xg-c-5.ok xg-c-5.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-6.in.C"
cat <<EOF > xg-c-6.in.C
/* This comment will not be extracted. */
gettext ("help");
dgettext ("bar", "!");
EOF
-tmpfiles="$tmpfiles xg-c-6.tmp.po xg-c-6.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=XXX \
- -d xg-c-6.tmp xg-c-6.in.C
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-6.tmp.po > xg-c-6.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-c-6.tmp xg-c-6.in.C || exit 1
+LC_ALL=C tr -d '\r' < xg-c-6.tmp.po > xg-c-6.po || exit 1
-tmpfiles="$tmpfiles xg-c-6.ok"
cat <<EOF > xg-c-6.ok
msgid "help"
msgstr ""
${DIFF} xg-c-6.ok xg-c-6.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C support: comments.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-7.c"
cat <<EOF > xg-c-7.c
int
main()
}
EOF
-tmpfiles="$tmpfiles xg-c-7.tmp.po xg-c-7.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -c --c++ -d xg-c-7.tmp xg-c-7.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-7.tmp.po > xg-c-7.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -c --c++ -d xg-c-7.tmp xg-c-7.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-7.tmp.po > xg-c-7.po || exit 1
-tmpfiles="$tmpfiles xg-c-7.ok"
cat <<EOF > xg-c-7.ok
#. This is a comment which immediately before a keyword.
msgid "1"
${DIFF} xg-c-7.ok xg-c-7.po
result=$?
-rm -fr $tmpfiles
-
exit $result
Local Variables:
# Test recognition of ISO C 99 <inttypes.h> format string directives.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-8.c"
cat <<EOF > xg-c-8.c
void foo ()
{
}
EOF
-tmpfiles="$tmpfiles xg-c-8.tmp xg-c-8.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -k_ -o xg-c-8.tmp xg-c-8.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-8.tmp > xg-c-8.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -k_ -o xg-c-8.tmp xg-c-8.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-8.tmp > xg-c-8.po || exit 1
-tmpfiles="$tmpfiles xg-c-8.ok"
cat <<EOF > xg-c-8.ok
#, c-format
msgid "File size is: %<PRId64>"
${DIFF} xg-c-8.ok xg-c-8.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-9.c"
cat <<EOF > xg-c-9.c
// This comment will not be extracted.
print (gettext ("help"));
"verbose string"));
EOF
-tmpfiles="$tmpfiles xg-c-9.tmp.po xg-c-9.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-c-9.tmp xg-c-9.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-9.tmp.po > xg-c-9.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-c-9.tmp xg-c-9.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-9.tmp.po > xg-c-9.po || exit 1
-tmpfiles="$tmpfiles xg-c-9.ok"
cat <<EOF > xg-c-9.ok
msgid "help"
msgstr ""
${DIFF} xg-c-9.ok xg-c-9.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Some tests for C# support
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-cs-1.cs"
cat <<EOF > xg-cs-1.cs
using GNU.Gettext;
class TestCase {
}
EOF
-tmpfiles="$tmpfiles xg-cs-1.tmp.po xg-cs-1.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -c -d xg-cs-1.tmp xg-cs-1.cs
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-cs-1.tmp.po > xg-cs-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -c -d xg-cs-1.tmp xg-cs-1.cs || exit 1
+LC_ALL=C tr -d '\r' < xg-cs-1.tmp.po > xg-cs-1.po || exit 1
-tmpfiles="$tmpfiles xg-cs-1.ok"
cat <<EOF > xg-cs-1.ok
#. standard usage
msgid "Test String 1"
${DIFF} xg-cs-1.ok xg-cs-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# More tests for C# support: UTF-8 encoded source files
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-cs-2.cs"
cat <<\EOF > xg-cs-2.cs
class TestCase {
public static void Main (String[] args) {
}
EOF
-tmpfiles="$tmpfiles xg-cs-2.po"
: ${XGETTEXT=xgettext}
# delete POT-Creation-Date: line because the date depends on local time.
${XGETTEXT} --output - --add-location -c --from-code=UTF-8 xg-cs-2.cs \
- | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-cs-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-cs-2.po || exit 1
-tmpfiles="$tmpfiles xg-cs-2.ok"
cat <<\EOF > xg-cs-2.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-cs-2.ok xg-cs-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# More tests for C# support: string syntax
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-cs-3.cs"
LC_ALL=C tr '%' '\015' <<\EOF > xg-cs-3.cs
class TestCase {
public static void Main (String[] args) {
}
EOF
-tmpfiles="$tmpfiles xg-cs-3.po"
: ${XGETTEXT=xgettext}
# delete POT-Creation-Date: line because the date depends on local time.
${XGETTEXT} --output - --add-location -c -kMyGetString:2 xg-cs-3.cs 2>/dev/null \
- | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-cs-3.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-cs-3.po || exit 1
-tmpfiles="$tmpfiles xg-cs-3.ok"
cat <<\EOF > xg-cs-3.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-cs-3.ok xg-cs-3.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Tests for C# plural keyword support
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-cs-4.cs"
cat <<EOF > xg-cs-4.cs
class TestCase {
public static void Main (String[] args) {
}
EOF
-tmpfiles="$tmpfiles xg-cs-4.tmp.po xg-cs-4.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --keyword=MyPluralString:2,3 \
- -d xg-cs-4.tmp xg-cs-4.cs
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-cs-4.tmp.po > xg-cs-4.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-cs-4.tmp xg-cs-4.cs || exit 1
+LC_ALL=C tr -d '\r' < xg-cs-4.tmp.po > xg-cs-4.po || exit 1
-tmpfiles="$tmpfiles xg-cs-4.ok"
cat <<EOF > xg-cs-4.ok
msgid "test 1"
msgid_plural "plural test"
${DIFF} xg-cs-4.ok xg-cs-4.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C# support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-cs-5.cs"
cat <<EOF > xg-cs-5.cs
// This comment will not be extracted.
Console.WriteLine(GetString("help"));
+ "verbose string"));
EOF
-tmpfiles="$tmpfiles xg-cs-5.tmp.po xg-cs-5.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-cs-5.tmp xg-cs-5.cs
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-cs-5.tmp.po > xg-cs-5.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-cs-5.tmp xg-cs-5.cs || exit 1
+LC_ALL=C tr -d '\r' < xg-cs-5.tmp.po > xg-cs-5.po || exit 1
-tmpfiles="$tmpfiles xg-cs-5.ok"
cat <<EOF > xg-cs-5.ok
msgid "help"
msgstr ""
${DIFF} xg-cs-5.ok xg-cs-5.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C# support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-cs-6.cs"
cat <<\EOF > xg-cs-6.cs
/* a */
/* b */ string s = /* c */
/* e */ _( /* f */ "hello " /* g */ + /* h */ "world" /* i */ );
EOF
-tmpfiles="$tmpfiles xg-cs-6.tmp.po xg-cs-6.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
- -d xg-cs-6.tmp xg-cs-6.cs
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-cs-6.tmp.po > xg-cs-6.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-cs-6.tmp xg-cs-6.cs || exit 1
+LC_ALL=C tr -d '\r' < xg-cs-6.tmp.po > xg-cs-6.po || exit 1
-tmpfiles="$tmpfiles xg-cs-6.ok"
cat <<EOF > xg-cs-6.ok
#. a
#. b
${DIFF} xg-cs-6.ok xg-cs-6.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C# support: extraction of contexts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-cs-7.cs"
cat <<\EOF > xg-cs-7.cs
Console.WriteLine(rm.GetString("help"));
Console.WriteLine(rm.GetParticularString("Help", "about"));
EOF
-tmpfiles="$tmpfiles xg-cs-7.tmp.po xg-cs-7.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -d xg-cs-7.tmp xg-cs-7.cs
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-cs-7.tmp.po > xg-cs-7.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -d xg-cs-7.tmp xg-cs-7.cs || exit 1
+LC_ALL=C tr -d '\r' < xg-cs-7.tmp.po > xg-cs-7.po || exit 1
-tmpfiles="$tmpfiles xg-cs-7.ok"
cat <<EOF > xg-cs-7.ok
msgid "help"
msgstr ""
${DIFF} xg-cs-7.ok xg-cs-7.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test EmacsLisp support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-el-1.el"
cat <<EOF > xg-el-1.el
; This comment will not be extracted.
(princ (_ "help"))
(princ (_ "The Fabulous Four"))
EOF
-tmpfiles="$tmpfiles xg-el-1.tmp.po xg-el-1.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-el-1.tmp xg-el-1.el
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-el-1.tmp.po > xg-el-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-el-1.tmp xg-el-1.el || exit 1
+LC_ALL=C tr -d '\r' < xg-el-1.tmp.po > xg-el-1.po || exit 1
-tmpfiles="$tmpfiles xg-el-1.ok"
cat <<EOF > xg-el-1.ok
msgid "help"
msgstr ""
${DIFF} xg-el-1.ok xg-el-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test EmacsLisp support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-el-2.el"
cat <<\EOF > xg-el-2.el
; a
(setq string ; b
))
EOF
-tmpfiles="$tmpfiles xg-el-2.tmp.po xg-el-2.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
- -d xg-el-2.tmp xg-el-2.el
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-el-2.tmp.po > xg-el-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-el-2.tmp xg-el-2.el || exit 1
+LC_ALL=C tr -d '\r' < xg-el-2.tmp.po > xg-el-2.po || exit 1
-tmpfiles="$tmpfiles xg-el-2.ok"
cat <<EOF > xg-el-2.ok
#. a
#. b
${DIFF} xg-el-2.ok xg-el-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of Glade support.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-gl-1-empty.glade"
cat <<EOF > xg-gl-1-empty.glade
<?xml version="1.0"?>
<GTK-Interface/>
EOF
-tmpfiles="$tmpfiles xg-gl-1.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} -o xg-gl-1.pot xg-gl-1-empty.glade 2>/dev/null
test $? = 0 || {
echo "Skipping test: xgettext was built without Glade support"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles xg-gl-1-widgets.glade"
cat <<EOF > xg-gl-1-widgets.glade
<?xml version="1.0"?>
<GTK-Interface>
</GTK-Interface>
EOF
-tmpfiles="$tmpfiles xg-gl-1.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --add-comments -o - xg-gl-1-widgets.glade | grep -v 'POT-Creation-Date' > xg-gl-1.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --add-comments -o - xg-gl-1-widgets.glade | grep -v 'POT-Creation-Date' > xg-gl-1.pot || exit 1
-tmpfiles="$tmpfiles xg-gl-1.ok"
cat <<EOF > xg-gl-1.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-gl-1.ok xg-gl-1.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of Glade support, in particular ISO-8859-1 to UTF-8 conversion
# and ASCII entities (< > ").
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-gl-2-empty.glade"
cat <<EOF > xg-gl-2-empty.glade
<?xml version="1.0"?>
<GTK-Interface/>
EOF
-tmpfiles="$tmpfiles xg-gl-2.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} -o xg-gl-2.pot xg-gl-2-empty.glade 2>/dev/null
test $? = 0 || {
echo "Skipping test: xgettext was built without Glade support"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles xg-gl-2-simple.glade"
cat <<\EOF > xg-gl-2-simple.glade
<?xml version="1.0" encoding="ISO-8859-1"?>
<GTK-Interface>
</GTK-Interface>
EOF
-tmpfiles="$tmpfiles xg-gl-2.tmp xg-gl-2.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --add-comments -o xg-gl-2.tmp xg-gl-2-simple.glade
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --add-comments -o xg-gl-2.tmp xg-gl-2-simple.glade || exit 1
# Don't simplify this to "grep ... < xg-gl-2.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-gl-2.tmp | grep -v 'POT-Creation-Date' > xg-gl-2.pot
-tmpfiles="$tmpfiles xg-gl-2.ok"
cat <<\EOF > xg-gl-2.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-gl-2.ok xg-gl-2.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of Glade 2 support.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-gl-3-empty.glade"
cat <<EOF > xg-gl-3-empty.glade
<?xml version="1.0"?>
<GTK-Interface/>
EOF
-tmpfiles="$tmpfiles xg-gl-3.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} -o xg-gl-3.pot xg-gl-3-empty.glade 2>/dev/null
test $? = 0 || {
echo "Skipping test: xgettext was built without Glade support"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles xg-gl-3-asciitable.glade2"
cat <<EOF > xg-gl-3-asciitable.glade2
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd" >
</glade-interface>
EOF
-tmpfiles="$tmpfiles xg-gl-3.tmp xg-gl-3.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o xg-gl-3.tmp xg-gl-3-asciitable.glade2
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o xg-gl-3.tmp xg-gl-3-asciitable.glade2 || exit 1
# Don't simplify this to "grep ... < xg-gl-3.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-gl-3.tmp | grep -v 'POT-Creation-Date' > xg-gl-3.pot
-tmpfiles="$tmpfiles xg-gl-3.ok"
cat <<\EOF > xg-gl-3.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-gl-3.ok xg-gl-3.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of Glade 2 support.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-gl-4-empty.glade"
cat <<EOF > xg-gl-4-empty.glade
<?xml version="1.0"?>
<GTK-Interface/>
EOF
-tmpfiles="$tmpfiles xg-gl-4.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} -o xg-gl-4.pot xg-gl-4-empty.glade 2>/dev/null
test $? = 0 || {
echo "Skipping test: xgettext was built without Glade support"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles xg-gl-4.glade"
cat <<EOF > xg-gl-4.glade
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
</glade-interface>
EOF
-tmpfiles="$tmpfiles xg-gl-4.tmp xg-gl-4.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o xg-gl-4.tmp xg-gl-4.glade
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o xg-gl-4.tmp xg-gl-4.glade || exit 1
# Don't simplify this to "grep ... < xg-gl-4.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-gl-4.tmp | grep -v 'POT-Creation-Date' > xg-gl-4.pot
-tmpfiles="$tmpfiles xg-gl-4.ok"
cat <<\EOF > xg-gl-4.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
rm -fr $tempfiles; exit $result
}
-tmpfiles="$tmpfiles xg-gl-4a.glade"
cat <<EOF > xg-gl-4a.glade
<?xml version="1.0"?>
<glade-interface>
</glade-interface>
EOF
-tmpfiles="$tmpfiles xg-gl-4a.tmp xg-gl-4a.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o xg-gl-4a.tmp xg-gl-4a.glade
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o xg-gl-4a.tmp xg-gl-4a.glade || exit 1
# Look upwards
cat xg-gl-4a.tmp | grep -v 'POT-Creation-Date' > xg-gl-4a.pot
-tmpfiles="$tmpfiles xg-gl-4a.ok"
cat <<\EOF > xg-gl-4a.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-gl-4a.ok xg-gl-4a.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of Glade 2 support for msgctxt.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-gl-5-empty.glade"
cat <<EOF > xg-gl-5-empty.glade
<?xml version="1.0"?>
<GTK-Interface/>
EOF
-tmpfiles="$tmpfiles xg-gl-5.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} -o xg-gl-5.pot xg-gl-5-empty.glade 2>/dev/null
test $? = 0 || {
echo "Skipping test: xgettext was built without Glade support"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles xg-gl-5.glade"
cat <<EOF > xg-gl-5.glade
<?xml version="1.0"?>
<glade-interface>
</glade-interface>
EOF
-tmpfiles="$tmpfiles xg-gl-5.tmp xg-gl-5.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o xg-gl-5.tmp xg-gl-5.glade
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o xg-gl-5.tmp xg-gl-5.glade || exit 1
# Don't simplify this to "grep ... < xg-gl-5.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-gl-5.tmp | grep -v 'POT-Creation-Date' > xg-gl-5.pot
-tmpfiles="$tmpfiles xg-gl-5.ok"
cat <<\EOF > xg-gl-5.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
result=$?
test $result = 0 || {
- rm -fr $tmpfiles; exit $result
+ exit $result
}
# Check with --extract-all option
rm xg-gl-5.tmp
-${XGETTEXT} -a -o xg-gl-5.tmp xg-gl-5.glade
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -a -o xg-gl-5.tmp xg-gl-5.glade || exit 1
# Don't simplify this to "grep ... < xg-gl-5.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-gl-5.tmp | grep -v 'POT-Creation-Date' > xg-gl-5.pot
result=$?
test $result = 0 || {
- rm -fr $tmpfiles; exit $result
+ exit $result
}
-tmpfiles="$tmpfiles xg-gl-5b.glade"
cat <<EOF > xg-gl-5b.glade
<?xml version="1.0"?>
<glade-interface>
</glade-interface>
EOF
-tmpfiles="$tmpfiles xg-gl-5b.tmp xg-gl-5b.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o xg-gl-5b.tmp xg-gl-5b.glade 2>/dev/null
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o xg-gl-5b.tmp xg-gl-5b.glade 2>/dev/null || exit 1
# Don't simplify this to "grep ... < xg-gl-5b.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-gl-5b.tmp | grep -v 'POT-Creation-Date' > xg-gl-5b.pot
-tmpfiles="$tmpfiles xg-gl-5b.ok"
cat <<\EOF > xg-gl-5b.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-gl-5b.ok xg-gl-5b.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Checks that the extracted pot contains the right translatable
# content, comments and context.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-gl-6-empty.glade"
cat <<EOF > xg-gl-6-empty.glade
<?xml version="1.0"?>
<GTK-Interface/>
EOF
-tmpfiles="$tmpfiles xg-gl-6.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} -o xg-gl-6.pot xg-gl-6-empty.glade 2>/dev/null
test $? = 0 || {
echo "Skipping test: xgettext was built without Glade support"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles xg-gl-6.ui"
cat <<EOF > xg-gl-6.ui
<?xml version="1.0" encoding="UTF-8"?>
<interface>
</interface>
EOF
-tmpfiles="$tmpfiles xg-gl-6.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o - xg-gl-6.ui | grep -v 'POT-Creation-Date' > xg-gl-6.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o - xg-gl-6.ui | grep -v 'POT-Creation-Date' > xg-gl-6.pot || exit 1
-tmpfiles="$tmpfiles xg-gl-6.ok"
cat <<EOF > xg-gl-6.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
result=$?
test $result = 0 || {
- rm -fr $tmpfiles; exit $result
+ exit $result
}
# Check with --extract-all option.
-${XGETTEXT} -a -o - xg-gl-6.ui | grep -v 'POT-Creation-Date' > xg-gl-6.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -a -o - xg-gl-6.ui | grep -v 'POT-Creation-Date' > xg-gl-6.pot || exit 1
# Must be ignored.
${DIFF} xg-gl-6.ok xg-gl-6.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Checks the extraction of a medium size GtkBuilder file, with
# comments, context and translatable and not translatable content.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-gl-7-empty.glade"
cat <<EOF > xg-gl-7-empty.glade
<?xml version="1.0"?>
<GTK-Interface/>
EOF
-tmpfiles="$tmpfiles xg-gl-7.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} -o xg-gl-7.pot xg-gl-7-empty.glade 2>/dev/null
test $? = 0 || {
echo "Skipping test: xgettext was built without Glade support"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles xg-gl-7.ui"
cat <<EOF > xg-gl-7.ui
<?xml version="1.0" encoding="UTF-8"?>
<interface>
</interface>
EOF
-tmpfiles="$tmpfiles xg-gl-7.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o - xg-gl-7.ui | grep -v 'POT-Creation-Date' > xg-gl-7.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o - xg-gl-7.ui | grep -v 'POT-Creation-Date' > xg-gl-7.pot || exit 1
-tmpfiles="$tmpfiles xg-gl-7.ok"
cat <<\EOF > xg-gl-7.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-gl-7.ok xg-gl-7.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of GSettings support.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-gs-1-empty.gschema.xml"
cat <<EOF > xg-gs-1-empty.gschema.xml
<?xml version="1.0"?>
<schemalist/>
EOF
-tmpfiles="$tmpfiles xg-gs-1.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} -o xg-gs-1.pot xg-gs-1-empty.gschema.xml 2>/dev/null
test $? = 0 || {
echo "Skipping test: xgettext was built without GSettings support"
- rm -fr $tmpfiles; exit 77
+ exit 77
}
-tmpfiles="$tmpfiles xg-gs-1.gschema.xml"
cat <<EOF > xg-gs-1.gschema.xml
<?xml version="1.0"?>
<schemalist>
</schemalist>
EOF
-tmpfiles="$tmpfiles xg-gs-1.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --add-comments -o - xg-gs-1.gschema.xml | grep -v 'POT-Creation-Date' > xg-gs-1.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --add-comments -o - xg-gs-1.gschema.xml | grep -v 'POT-Creation-Date' > xg-gs-1.pot || exit 1
-tmpfiles="$tmpfiles xg-gs-1.ok"
cat <<EOF > xg-gs-1.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-gs-1.ok xg-gs-1.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Some tests for java support
#
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-j-1.java"
cat <<EOF > xg-j-1.java
class TestCase {
public TestCase() {
}
EOF
-tmpfiles="$tmpfiles xg-j-1.tmp.po xg-j-1.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -c -d xg-j-1.tmp xg-j-1.java
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-j-1.tmp.po > xg-j-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -c -d xg-j-1.tmp xg-j-1.java || exit 1
+LC_ALL=C tr -d '\r' < xg-j-1.tmp.po > xg-j-1.po || exit 1
-tmpfiles="$tmpfiles xg-j-1.ok"
cat <<EOF > xg-j-1.ok
#. standard usage
msgid "Test String 1"
${DIFF} xg-j-1.ok xg-j-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# More tests for java support
#
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-j-2.java"
cat <<\EOF > xg-j-2.java
class TestCase {
public static void main (String[] args) {
}
EOF
-tmpfiles="$tmpfiles xg-j-2.tmp xg-j-2.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --from-code=ISO-8859-1 -c -o xg-j-2.tmp xg-j-2.java 2>/dev/null
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --from-code=ISO-8859-1 -c -o xg-j-2.tmp xg-j-2.java 2>/dev/null || exit 1
# Don't simplify this to "grep ... < xg-j-2.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-j-2.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-j-2.pot
-tmpfiles="$tmpfiles xg-j-2.ok"
cat <<\EOF > xg-j-2.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-j-2.ok xg-j-2.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Some tests for java plural keyword support
#
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-j-3.java"
cat <<EOF > xg-j-3.java
class TestCase {
public TestCase() {
}
EOF
-tmpfiles="$tmpfiles xg-j-3.tmp.po xg-j-3.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -d xg-j-3.tmp xg-j-3.java
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-j-3.tmp.po > xg-j-3.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -d xg-j-3.tmp xg-j-3.java || exit 1
+LC_ALL=C tr -d '\r' < xg-j-3.tmp.po > xg-j-3.po || exit 1
-tmpfiles="$tmpfiles xg-j-3.ok"
cat <<EOF > xg-j-3.ok
msgid "test 1"
msgid_plural "plural test"
${DIFF} xg-j-3.ok xg-j-3.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Some tests for java plural keyword support
#
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-j-4.java"
cat <<EOF > xg-j-4.java
class TestCase {
public TestCase() {
}
EOF
-tmpfiles="$tmpfiles xg-j-4.tmp.po xg-j-4.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --keyword=ngettext:2,3 \
- -d xg-j-4.tmp xg-j-4.java
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-j-4.tmp.po > xg-j-4.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-j-4.tmp xg-j-4.java || exit 1
+LC_ALL=C tr -d '\r' < xg-j-4.tmp.po > xg-j-4.po || exit 1
-tmpfiles="$tmpfiles xg-j-4.ok"
cat <<EOF > xg-j-4.ok
msgid "test 1"
msgid_plural "plural test"
${DIFF} xg-j-4.ok xg-j-4.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Java support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-j-5.java"
cat <<EOF > xg-j-5.java
// This comment will not be extracted.
System.out.println(gettext("help"));
+ "verbose string"));
EOF
-tmpfiles="$tmpfiles xg-j-5.tmp.po xg-j-5.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-j-5.tmp xg-j-5.java
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-j-5.tmp.po > xg-j-5.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-j-5.tmp xg-j-5.java || exit 1
+LC_ALL=C tr -d '\r' < xg-j-5.tmp.po > xg-j-5.po || exit 1
-tmpfiles="$tmpfiles xg-j-5.ok"
cat <<EOF > xg-j-5.ok
msgid "help"
msgstr ""
${DIFF} xg-j-5.ok xg-j-5.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Java support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-j-6.java"
cat <<\EOF > xg-j-6.java
/* a */
/* b */ String string = /* c */
/* e */ _( /* f */ "hello " /* g */ + /* h */ "world" /* i */ );
EOF
-tmpfiles="$tmpfiles xg-j-6.tmp.po xg-j-6.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
- -d xg-j-6.tmp xg-j-6.java
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-j-6.tmp.po > xg-j-6.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-j-6.tmp xg-j-6.java || exit 1
+LC_ALL=C tr -d '\r' < xg-j-6.tmp.po > xg-j-6.po || exit 1
-tmpfiles="$tmpfiles xg-j-6.ok"
cat <<EOF > xg-j-6.ok
#. a
#. b
${DIFF} xg-j-6.ok xg-j-6.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Java support: extraction of contexts.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-j-7.java"
cat <<\EOF > xg-j-7.java
import gnu.gettext.GettextResourceBundle;
System.out.println(GettextResourceBundle.gettext("help"));
System.out.println(GettextResourceBundle.pgettext("Help", "about"));
EOF
-tmpfiles="$tmpfiles xg-j-7.tmp.po xg-j-7.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -d xg-j-7.tmp xg-j-7.java
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-j-7.tmp.po > xg-j-7.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -d xg-j-7.tmp xg-j-7.java || exit 1
+LC_ALL=C tr -d '\r' < xg-j-7.tmp.po > xg-j-7.po || exit 1
-tmpfiles="$tmpfiles xg-j-7.ok"
cat <<EOF > xg-j-7.ok
msgid "help"
msgstr ""
${DIFF} xg-j-7.ok xg-j-7.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of JavaScript support.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-js-1.js"
cat <<\EOF > xg-js-1.js
var s1 = "Simple string, no gettext needed",
s2 = _("Extract this first string");
gettext('Extract this fifth string');
EOF
-tmpfiles="$tmpfiles xg-js-1.err xg-js-1.tmp xg-js-1.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments=TRANSLATORS: --no-location -o xg-js-1.tmp xg-js-1.js 2>xg-js-1.err
-test $? = 0 || { cat xg-js-1.err; rm -fr $tmpfiles; exit 1; }
+test $? = 0 || { cat xg-js-1.err; exit 1; }
# Don't simplify this to "grep ... < xg-js-1.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-js-1.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-1.pot
-tmpfiles="$tmpfiles xg-js-1.ok"
cat <<\EOF > xg-js-1.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-js-1.ok xg-js-1.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of JavaScript support.
# Playing with regex and division operator
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-js-2.js"
cat <<\EOF > xg-js-2.js
// RegExp literals containing string quotes must not desync the parser
var d = 1 / 2 / 4;
var s9 = /_("a+")/.exec(_("RegExp test string #16"));
EOF
-tmpfiles="$tmpfiles xg-js-2.err xg-js-2.tmp xg-js-2.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --no-location -o xg-js-2.tmp xg-js-2.js 2>xg-js-2.err
-test $? = 0 || { cat xg-js-2.err; rm -fr $tmpfiles; exit 1; }
+test $? = 0 || { cat xg-js-2.err; exit 1; }
# Don't simplify this to "grep ... < xg-js-2.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-js-2.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-2.pot
-tmpfiles="$tmpfiles xg-js-2.ok"
cat <<\EOF > xg-js-2.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-js-2.ok xg-js-2.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of JavaScript support.
# Playing with concatenation of string literals within the gettext function
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-js-3.js"
cat <<\EOF > xg-js-3.js
// The usual way to concatenate strings is the plus '+' sign
var s1 = _("Concatenation #1 " + "- String part added");
' should' + " be " + 'extracted');
EOF
-tmpfiles="$tmpfiles xg-js-3.err xg-js-3.tmp xg-js-3.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments=TRANSLATORS: --no-location -o xg-js-3.tmp xg-js-3.js 2>xg-js-3.err
-test $? = 0 || { cat xg-js-3.err; rm -fr $tmpfiles; exit 1; }
+test $? = 0 || { cat xg-js-3.err; exit 1; }
# Don't simplify this to "grep ... < xg-js-3.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-js-3.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-3.pot
-tmpfiles="$tmpfiles xg-js-3.ok"
cat <<\EOF > xg-js-3.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-js-3.ok xg-js-3.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of JavaScript escape sequences in string literals.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-js-4.js"
cat <<\EOF > xg-js-4.js
var s1 = _("Unicode escape \u3042");
var s2 = _("Surrogate pair \uD835\uDC9C");
var s3 = _("Escape sequence \1411 \x622 \xxx \y");
EOF
-tmpfiles="$tmpfiles xg-js-4.err xg-js-4.tmp xg-js-4.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --no-location -o xg-js-4.tmp xg-js-4.js 2>xg-js-4.err
-test $? = 0 || { cat xg-js-4.err; rm -fr $tmpfiles; exit 1; }
+test $? = 0 || { cat xg-js-4.err; exit 1; }
# Don't simplify this to "grep ... < xg-js-4.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-js-4.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-4.pot
-tmpfiles="$tmpfiles xg-js-4.ok"
cat <<\EOF > xg-js-4.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-js-4.ok xg-js-4.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of JavaScript Unicode support.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-js-5.js"
cat <<\EOF > xg-js-5.js
// the following except is stolen from json2.js
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ _("Expected translation string #4");
EOF
-tmpfiles="$tmpfiles xg-js-5.err xg-js-5.tmp xg-js-5.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --no-location -o xg-js-5.tmp xg-js-5.js 2>xg-js-5.err
-test $? = 0 || { cat xg-js-5.err; rm -fr $tmpfiles; exit 1; }
+test $? = 0 || { cat xg-js-5.err; exit 1; }
# Don't simplify this to "grep ... < xg-js-5.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-js-5.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-5.pot
-tmpfiles="$tmpfiles xg-js-5.ok"
cat <<\EOF > xg-js-5.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-js-5.ok xg-js-5.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of JavaScript E4X support.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-js-6.js"
cat <<\EOF > xg-js-6.js
var x1 = <x1></x1>;
var s1 = _("Expected translation string #1");
</foo>;
EOF
-tmpfiles="$tmpfiles xg-js-6.err xg-js-6.tmp xg-js-6.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --no-location -o xg-js-6.tmp xg-js-6.js 2>xg-js-6.err
-test $? = 0 || { cat xg-js-6.err; rm -fr $tmpfiles; exit 1; }
+test $? = 0 || { cat xg-js-6.err; exit 1; }
# Don't simplify this to "grep ... < xg-js-6.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-js-6.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-6.pot
-tmpfiles="$tmpfiles xg-js-6.ok"
cat <<\EOF > xg-js-6.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-js-6.ok xg-js-6.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test librep support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-lr-1.jl"
cat <<EOF > xg-lr-1.jl
; This comment will not be extracted.
(princ (_ "help"))
(princ (_ "The Fabulous Four"))
EOF
-tmpfiles="$tmpfiles xg-lr-1.tmp.po xg-lr-1.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-lr-1.tmp xg-lr-1.jl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-lr-1.tmp.po > xg-lr-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-lr-1.tmp xg-lr-1.jl || exit 1
+LC_ALL=C tr -d '\r' < xg-lr-1.tmp.po > xg-lr-1.po || exit 1
-tmpfiles="$tmpfiles xg-lr-1.ok"
cat <<EOF > xg-lr-1.ok
msgid "help"
msgstr ""
${DIFF} xg-lr-1.ok xg-lr-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test librep support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-lr-2.jl"
cat <<\EOF > xg-lr-2.jl
#| a |#
#| b |# (setq string #| c |#
#| e |# (_ #| f |# "hello world" #| g |# ))
EOF
-tmpfiles="$tmpfiles xg-lr-2.tmp.po xg-lr-2.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
- -d xg-lr-2.tmp xg-lr-2.jl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-lr-2.tmp.po > xg-lr-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-lr-2.tmp xg-lr-2.jl || exit 1
+LC_ALL=C tr -d '\r' < xg-lr-2.tmp.po > xg-lr-2.po || exit 1
-tmpfiles="$tmpfiles xg-lr-2.ok"
cat <<EOF > xg-lr-2.ok
#. a
#. b
${DIFF} xg-lr-2.ok xg-lr-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Lisp support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-ls-1.lisp"
cat <<EOF > xg-ls-1.lisp
; This comment will not be extracted.
(write-line (gettext "help"))
(write-line (gettext "The Fabulous Four"))
EOF
-tmpfiles="$tmpfiles xg-ls-1.tmp.po xg-ls-1.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-ls-1.tmp xg-ls-1.lisp
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-ls-1.tmp.po > xg-ls-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-ls-1.tmp xg-ls-1.lisp || exit 1
+LC_ALL=C tr -d '\r' < xg-ls-1.tmp.po > xg-ls-1.po || exit 1
-tmpfiles="$tmpfiles xg-ls-1.ok"
cat <<EOF > xg-ls-1.ok
msgid "help"
msgstr ""
${DIFF} xg-ls-1.ok xg-ls-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Lisp support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-ls-2.lisp"
cat <<\EOF > xg-ls-2.lisp
#| a |#
#| b |# (setq string #| c |#
#| e |# (_ #| f |# "hello world" #| g |# ))
EOF
-tmpfiles="$tmpfiles xg-ls-2.tmp.po xg-ls-2.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
- -d xg-ls-2.tmp xg-ls-2.lisp
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-ls-2.tmp.po > xg-ls-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-ls-2.tmp xg-ls-2.lisp || exit 1
+LC_ALL=C tr -d '\r' < xg-ls-2.tmp.po > xg-ls-2.po || exit 1
-tmpfiles="$tmpfiles xg-ls-2.ok"
cat <<EOF > xg-ls-2.ok
#. a
#. b
${DIFF} xg-ls-2.ok xg-ls-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Lua support
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-lu-1.lua"
cat <<\EOF > xg-lu-1.lua
print(_("This is a test string."))
print(_('And another one.'))
print(speed / 1000 .. 'Mbps')
EOF
-tmpfiles="$tmpfiles xg-lu-1.tmp.po xg-lu-1.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-lu-1.tmp xg-lu-1.lua
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-lu-1.tmp.po > xg-lu-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-lu-1.tmp xg-lu-1.lua || exit 1
+LC_ALL=C tr -d '\r' < xg-lu-1.tmp.po > xg-lu-1.po || exit 1
-tmpfiles="$tmpfiles xg-lu-1.ok"
cat <<EOF > xg-lu-1.ok
msgid "This is a test string."
msgstr ""
${DIFF} xg-lu-1.ok xg-lu-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Lua support
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-lu-2.lua"
cat <<\EOF > xg-lu-2.lua
-- This comment won't be extracted.
print(_"Hmm.")
print(_"A string.")
EOF
-tmpfiles="$tmpfiles xg-lu-2.tmp.po xg-lu-2.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-lu-2.tmp xg-lu-2.lua
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-lu-2.tmp.po > xg-lu-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-lu-2.tmp xg-lu-2.lua || exit 1
+LC_ALL=C tr -d '\r' < xg-lu-2.tmp.po > xg-lu-2.po || exit 1
-tmpfiles="$tmpfiles xg-lu-2.ok"
cat <<EOF > xg-lu-2.ok
msgid "Hmm."
msgstr ""
${DIFF} xg-lu-2.ok xg-lu-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# 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 */
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"
${DIFF} xg-ob-1.ok xg-ob-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test ObjectiveC support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-ob-2.m"
cat <<EOF > xg-ob-2.m
// This comment will not be extracted.
print (NSLocalizedString (@
@ "verbose string"));
EOF
-tmpfiles="$tmpfiles xg-ob-2.tmp.po xg-ob-2.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-ob-2.tmp xg-ob-2.m
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-ob-2.tmp.po > xg-ob-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-ob-2.tmp xg-ob-2.m || exit 1
+LC_ALL=C tr -d '\r' < xg-ob-2.tmp.po > xg-ob-2.po || exit 1
-tmpfiles="$tmpfiles xg-ob-2.ok"
cat <<EOF > xg-ob-2.ok
msgid "help"
msgstr ""
${DIFF} xg-ob-2.ok xg-ob-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of Perl support.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-pl-1.pl"
cat <<\EOF > xg-pl-1.pl
use Locale::Messages qw (textdomain bindtextdomain gettext ngettext dngettext);
gettext "Discarded!";
EOF
-tmpfiles="$tmpfiles xg-pl-1.tmp.po xg-pl-1.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header -n \
-k_ --flag=_:1:pass-perl-format --flag=_:1:pass-perl-brace-format \
-k%__ --flag=%__:1:pass-perl-format --flag=%__:1:pass-perl-brace-format \
-k\$__ --flag=\$__:1:pass-perl-format --flag=\$__:1:pass-perl-brace-format \
- -d xg-pl-1.tmp xg-pl-1.pl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-pl-1.tmp.po > xg-pl-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-pl-1.tmp xg-pl-1.pl || exit 1
+LC_ALL=C tr -d '\r' < xg-pl-1.tmp.po > xg-pl-1.po || exit 1
-tmpfiles="$tmpfiles xg-pl-1.ok"
cat <<\EOF > xg-pl-1.ok
#: xg-pl-1.pl:9
msgid "'Your command, please?', asked the waiter."
${DIFF} xg-pl-1.ok xg-pl-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of Perl support with ISO-8859-1 encoded input.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-pl-2.pl"
cat <<\EOF > xg-pl-2.pl
use charnames ':full';
printf "%s\n", gettext "Böse Bübchen - wo sind sie blo\N{LATIN SMALL LETTER SHARP S}?";
STR
EOF
-tmpfiles="$tmpfiles xg-pl-2.po"
: ${XGETTEXT=xgettext}
# delete POT-Creation-Date: line because the date depends on local time.
${XGETTEXT} --output - --from-code=ISO-8859-1 xg-pl-2.pl \
- | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-pl-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-pl-2.po || exit 1
-tmpfiles="$tmpfiles xg-pl-2.ok"
cat <<\EOF > xg-pl-2.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-pl-2.ok xg-pl-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of Perl support with UTF-8 encoded input.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-pl-3.pl"
cat <<\EOF > xg-pl-3.pl
use charnames ':full';
printf "%s\n", gettext "Böse Bübchen - wo sind sie blo\N{LATIN SMALL LETTER SHARP S}?";
STR
EOF
-tmpfiles="$tmpfiles xg-pl-3.po"
: ${XGETTEXT=xgettext}
# delete POT-Creation-Date: line because the date depends on local time.
${XGETTEXT} --output - --from-code=UTF-8 xg-pl-3.pl \
- | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-pl-3.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-pl-3.po || exit 1
-tmpfiles="$tmpfiles xg-pl-3.ok"
cat <<\EOF > xg-pl-3.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-pl-3.ok xg-pl-3.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Tests for the general string extraction facilities of the Perl backend
# (with option --extract-all).
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-pl-4.pl"
cat <<\EOPERL > xg-pl-4.pl
use strict;
# "\x{430}\x{447}\x{43a}\x{430}\n";
EOPERL
-tmpfiles="$tmpfiles xg-pl-4.tmp.pot xg-pl-4.pot"
: ${XGETTEXT=xgettext}
LC_MESSAGES=C LC_ALL= \
-${XGETTEXT} -a --omit-header --no-location -o xg-pl-4.tmp.pot xg-pl-4.pl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-pl-4.tmp.pot > xg-pl-4.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -a --omit-header --no-location -o xg-pl-4.tmp.pot xg-pl-4.pl || exit 1
+LC_ALL=C tr -d '\r' < xg-pl-4.tmp.pot > xg-pl-4.pot || exit 1
-tmpfiles="$tmpfiles xg-pl-4.ok"
cat <<\EOF > xg-pl-4.ok
msgid "'Your command, please?', asked the waiter.\n"
msgstr ""
${DIFF} xg-pl-4.ok xg-pl-4.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Perl support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-pl-5.pl"
cat <<EOF > xg-pl-5.pl
# This comment will not be extracted.
print gettext "help";
print gettext "The Fabulous Four";
EOF
-tmpfiles="$tmpfiles xg-pl-5.tmp.po xg-pl-5.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-pl-5.tmp xg-pl-5.pl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-pl-5.tmp.po > xg-pl-5.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-pl-5.tmp xg-pl-5.pl || exit 1
+LC_ALL=C tr -d '\r' < xg-pl-5.tmp.po > xg-pl-5.po || exit 1
-tmpfiles="$tmpfiles xg-pl-5.ok"
cat <<EOF > xg-pl-5.ok
msgid "help"
msgstr ""
${DIFF} xg-pl-5.ok xg-pl-5.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test whether the right number of arguments are extracted.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-pl-6.pl"
cat <<\EOPERL > xg-pl-6.pl
use strict;
print dgettext foo 17, "extracted16";
EOPERL
-tmpfiles="$tmpfiles xg-pl-6.tmp xg-pl-6.pot"
: ${XGETTEXT=xgettext}
LC_MESSAGES=C LC_ALL= \
-${XGETTEXT} --omit-header --no-location -o xg-pl-6.tmp xg-pl-6.pl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-pl-6.tmp > xg-pl-6.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -o xg-pl-6.tmp xg-pl-6.pl || exit 1
+LC_ALL=C tr -d '\r' < xg-pl-6.tmp > xg-pl-6.pot || exit 1
-tmpfiles="$tmpfiles xg-pl-6.ok"
cat <<\EOF > xg-pl-6.ok
msgid "extracted1"
msgstr ""
${DIFF} xg-pl-6.ok xg-pl-6.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Perl support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-pl-7.pl"
cat <<\EOF > xg-pl-7.pl
# a
string = # b
);
EOF
-tmpfiles="$tmpfiles xg-pl-7.tmp.po xg-pl-7.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
- -d xg-pl-7.tmp xg-pl-7.pl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-pl-7.tmp.po > xg-pl-7.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-pl-7.tmp xg-pl-7.pl || exit 1
+LC_ALL=C tr -d '\r' < xg-pl-7.tmp.po > xg-pl-7.po || exit 1
-tmpfiles="$tmpfiles xg-pl-7.ok"
cat <<EOF > xg-pl-7.ok
#. a
#. b
${DIFF} xg-pl-7.ok xg-pl-7.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# or ternary respectively) or they are regex delimiters for pattern
# matches. This test case checks the proper recognition.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-pl-8.pl"
cat <<\EOF > xg-pl-8.pl
info(__("using %s."), ($a->b() eq "auto" ? "" : ""));
print __"Synching works.";
EOF
-tmpfiles="$tmpfiles xg-pl-8.tmp.po xg-pl-8.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header -n \
-k__ \
- -d xg-pl-8.tmp xg-pl-8.pl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-pl-8.tmp.po > xg-pl-8.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-pl-8.tmp xg-pl-8.pl || exit 1
+LC_ALL=C tr -d '\r' < xg-pl-8.tmp.po > xg-pl-8.po || exit 1
-tmpfiles="$tmpfiles xg-pl-8.ok"
cat <<\EOF > xg-pl-8.ok
#: xg-pl-8.pl:1
#, perl-format
${DIFF} xg-pl-8.ok xg-pl-8.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test PHP support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-ph-1.php"
cat <<EOF > xg-ph-1.php
<?
// This comment will not be extracted.
?>
EOF
-tmpfiles="$tmpfiles xg-ph-1.tmp.po xg-ph-1.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-ph-1.tmp xg-ph-1.php
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-ph-1.tmp.po > xg-ph-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-ph-1.tmp xg-ph-1.php || exit 1
+LC_ALL=C tr -d '\r' < xg-ph-1.tmp.po > xg-ph-1.po || exit 1
-tmpfiles="$tmpfiles xg-ph-1.ok"
cat <<EOF > xg-ph-1.ok
msgid "help"
msgstr ""
${DIFF} xg-ph-1.ok xg-ph-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test PHP support: here documents.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-ph-2.php"
cat <<EOF > xg-ph-2.php
<?
echo _("Egyptians");
?>
EOF
-tmpfiles="$tmpfiles xg-ph-2.tmp.po xg-ph-2.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -d xg-ph-2.tmp xg-ph-2.php
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-ph-2.tmp.po > xg-ph-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -d xg-ph-2.tmp xg-ph-2.php || exit 1
+LC_ALL=C tr -d '\r' < xg-ph-2.tmp.po > xg-ph-2.po || exit 1
-tmpfiles="$tmpfiles xg-ph-2.ok"
cat <<EOF > xg-ph-2.ok
msgid "Egyptians"
msgstr ""
${DIFF} xg-ph-2.ok xg-ph-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test PHP support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-ph-3.php"
cat <<\EOF > xg-ph-3.php
<?
/* a */
?>
EOF
-tmpfiles="$tmpfiles xg-ph-3.tmp.po xg-ph-3.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
- -d xg-ph-3.tmp xg-ph-3.php
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-ph-3.tmp.po > xg-ph-3.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-ph-3.tmp xg-ph-3.php || exit 1
+LC_ALL=C tr -d '\r' < xg-ph-3.tmp.po > xg-ph-3.po || exit 1
-tmpfiles="$tmpfiles xg-ph-3.ok"
cat <<EOF > xg-ph-3.ok
#. a
#. b
${DIFF} xg-ph-3.ok xg-ph-3.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test PHP support: string concatenation.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-ph-4.php"
cat <<EOF > xg-ph-4.php
<?
echo _("foo"."bar");
?>
EOF
-tmpfiles="$tmpfiles xg-ph-4.tmp.po xg-ph-4.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --extract-all \
- -d xg-ph-4.tmp xg-ph-4.php
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-ph-4.tmp.po > xg-ph-4.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-ph-4.tmp xg-ph-4.php || exit 1
+LC_ALL=C tr -d '\r' < xg-ph-4.tmp.po > xg-ph-4.po || exit 1
-tmpfiles="$tmpfiles xg-ph-4.ok"
cat <<EOF > xg-ph-4.ok
msgid "foobar"
msgstr ""
${DIFF} xg-ph-4.ok xg-ph-4.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C, C++, PO extractors.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-po-1.in.po xg-po-1.c xg-po-1.cc"
cat <<EOF > xg-po-1.in.po
#: file1.c:199
#, fuzzy
}
EOF
-tmpfiles="$tmpfiles xg-po-1.tmp.po xg-po-1.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header -n \
- -d xg-po-1.tmp xg-po-1.in.po xg-po-1.c xg-po-1.cc
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-po-1.tmp.po > xg-po-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-po-1.tmp xg-po-1.in.po xg-po-1.c xg-po-1.cc || exit 1
+LC_ALL=C tr -d '\r' < xg-po-1.tmp.po > xg-po-1.po || exit 1
-tmpfiles="$tmpfiles xg-po-1.ok"
cat <<EOF > xg-po-1.ok
#: file1.c:199
#, fuzzy
${DIFF} xg-po-1.ok xg-po-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test C, C++, JavaProperties extractors.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-pr-1.in.properties xg-pr-1.c xg-pr-1.cc"
cat <<EOF > xg-pr-1.in.properties
#: file1.c:199
#, fuzzy
}
EOF
-tmpfiles="$tmpfiles xg-pr-1.tmp.po xg-pr-1.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header -n \
- -d xg-pr-1.tmp xg-pr-1.in.properties xg-pr-1.c xg-pr-1.cc
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-pr-1.tmp.po > xg-pr-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-pr-1.tmp xg-pr-1.in.properties xg-pr-1.c xg-pr-1.cc || exit 1
+LC_ALL=C tr -d '\r' < xg-pr-1.tmp.po > xg-pr-1.po || exit 1
-tmpfiles="$tmpfiles xg-pr-1.ok"
cat <<EOF > xg-pr-1.ok
#: file1.c:199
#, fuzzy
${DIFF} xg-pr-1.ok xg-pr-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of Python support.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-py-1.py"
cat <<\EOF > xg-py-1.py
# interpret_ansic = true, interpret_unicode = false
_("abc\
"jkl" + mno)
EOF
-tmpfiles="$tmpfiles xg-py-1.err xg-py-1.tmp xg-py-1.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --no-location -o xg-py-1.tmp xg-py-1.py 2>xg-py-1.err
-test $? = 0 || { cat xg-py-1.err; rm -fr $tmpfiles; exit 1; }
+test $? = 0 || { cat xg-py-1.err; exit 1; }
# Don't simplify this to "grep ... < xg-py-1.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-py-1.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-py-1.pot
-tmpfiles="$tmpfiles xg-py-1.ok"
cat <<\EOF > xg-py-1.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-py-1.ok xg-py-1.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Python support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-py-2.py"
cat <<EOF > xg-py-2.py
# This comment will not be extracted.
print gettext.gettext("help")
"verbose string")
EOF
-tmpfiles="$tmpfiles xg-py-2.tmp.po xg-py-2.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-py-2.tmp xg-py-2.py
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-py-2.tmp.po > xg-py-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-py-2.tmp xg-py-2.py || exit 1
+LC_ALL=C tr -d '\r' < xg-py-2.tmp.po > xg-py-2.po || exit 1
-tmpfiles="$tmpfiles xg-py-2.ok"
cat <<EOF > xg-py-2.ok
msgid "help"
msgstr ""
${DIFF} xg-py-2.ok xg-py-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Python support: --from-code option and encoding recognition.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-py-3a.py"
cat <<\EOF > xg-py-3a.py
#!/usr/bin/env python
# TRANSLATORS: Fran\8f«®ois Pinard is a hero.
print gettext.gettext("ÆüËܸì");
EOF
-tmpfiles="$tmpfiles xg-py-3b.py"
cat <<\EOF > xg-py-3b.py
#!/usr/bin/env python
# Hey Emacs! -*- coding: euc-jp -*-
print gettext.gettext("ÆüËܸì");
EOF
-tmpfiles="$tmpfiles xg-py-3.ok"
cat <<\EOF > xg-py-3.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# Verify that if the source file has no magic coding comment, xgettext fails
# if no --from-code option is given but succeeds if it is given.
-tmpfiles="$tmpfiles xg-py-3a.tmp xg-py-3a.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments=TRANSLATORS: --no-location \
-d xg-py-3a xg-py-3a.py > /dev/null 2>&1
-test $? = 1 || { rm -fr $tmpfiles; exit 1; }
+test $? = 1 || { exit 1; }
${XGETTEXT} --add-comments=TRANSLATORS: --no-location --from-code=euc-jp \
- -o xg-py-3a.tmp xg-py-3a.py
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -o xg-py-3a.tmp xg-py-3a.py || exit 1
# Don't simplify this to "grep ... < xg-py-3a.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-py-3a.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-py-3a.pot
: ${DIFF=diff}
-${DIFF} xg-py-3.ok xg-py-3a.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${DIFF} xg-py-3.ok xg-py-3a.pot || exit 1
# Verify that if the source file has a magic coding comment, xgettext succeeds.
-tmpfiles="$tmpfiles xg-py-3b.tmp xg-py-3b.pot"
${XGETTEXT} --add-comments=TRANSLATORS: --no-location \
- -o xg-py-3b.tmp xg-py-3b.py
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -o xg-py-3b.tmp xg-py-3b.py || exit 1
# Don't simplify this to "grep ... < xg-py-3b.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-py-3b.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-py-3b.pot
-${DIFF} xg-py-3.ok xg-py-3b.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${DIFF} xg-py-3.ok xg-py-3b.pot || exit 1
# Verify that if the source file has a magic coding comment and a --from-code
# option is given, the magic coding comment takes precedence over it.
-tmpfiles="$tmpfiles xg-py-3c.tmp xg-py-3c.pot"
${XGETTEXT} --add-comments=TRANSLATORS: --no-location --from-code=iso-8859-1 \
- -o xg-py-3c.tmp xg-py-3b.py
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -o xg-py-3c.tmp xg-py-3b.py || exit 1
# Don't simplify this to "grep ... < xg-py-3c.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-py-3c.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-py-3c.pot
-${DIFF} xg-py-3.ok xg-py-3c.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${DIFF} xg-py-3.ok xg-py-3c.pot || exit 1
# Verify that backslashes in and second bytes with value 0x5C are correctly
# distinguished in weird encodings like BIG5.
-tmpfiles="$tmpfiles xg-py-3d.py"
cat <<\EOF > xg-py-3d.py
#!/usr/bin/env python
# Hey Emacs! -*- coding: big5 -*-
print gettext.gettext(u"¬\\u0021");
EOF
-tmpfiles="$tmpfiles xg-py-3d.tmp xg-py-3d.pot"
${XGETTEXT} --add-comments=TRANSLATORS: \
- -o xg-py-3d.tmp xg-py-3d.py
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -o xg-py-3d.tmp xg-py-3d.py || exit 1
# Don't simplify this to "grep ... < xg-py-3d.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-py-3d.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-py-3d.pot
-tmpfiles="$tmpfiles xg-py-3d.ok"
cat <<\EOF > xg-py-3d.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
msgstr ""
EOF
-${DIFF} xg-py-3d.ok xg-py-3d.pot
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-
-rm -fr $tmpfiles
+${DIFF} xg-py-3d.ok xg-py-3d.pot || exit 1
exit 0
# Test Python support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-py-4.py"
cat <<\EOF > xg-py-4.py
# a
string = # b
);
EOF
-tmpfiles="$tmpfiles xg-py-4.tmp.po xg-py-4.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
- -d xg-py-4.tmp xg-py-4.py
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-py-4.tmp.po > xg-py-4.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-py-4.tmp xg-py-4.py || exit 1
+LC_ALL=C tr -d '\r' < xg-py-4.tmp.po > xg-py-4.po || exit 1
-tmpfiles="$tmpfiles xg-py-4.ok"
cat <<EOF > xg-py-4.ok
#. a
#. b
${DIFF} xg-py-4.ok xg-py-4.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Scheme support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-sc-1.scm"
cat <<EOF > xg-sc-1.scm
; This comment will not be extracted.
(display (_ "help"))
(display (_ "The Fabulous Four"))
EOF
-tmpfiles="$tmpfiles xg-sc-1.tmp.po xg-sc-1.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} -k_ --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-sc-1.tmp xg-sc-1.scm
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-sc-1.tmp.po > xg-sc-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-sc-1.tmp xg-sc-1.scm || exit 1
+LC_ALL=C tr -d '\r' < xg-sc-1.tmp.po > xg-sc-1.po || exit 1
-tmpfiles="$tmpfiles xg-sc-1.ok"
cat <<EOF > xg-sc-1.ok
msgid "help"
msgstr ""
${DIFF} xg-sc-1.ok xg-sc-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Scheme support: strings outside any function call.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-sc-2.scm"
cat <<EOF > xg-sc-2.scm
(define foo '("bar" "quux"))
EOF
-tmpfiles="$tmpfiles xg-sc-2.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -k_ --omit-header --no-location --force-po -d xg-sc-2 xg-sc-2.scm
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -k_ --omit-header --no-location --force-po -d xg-sc-2 xg-sc-2.scm || exit 1
-tmpfiles="$tmpfiles xg-sc-2.ok"
cat <<EOF > xg-sc-2.ok
EOF
${DIFF} xg-sc-2.ok xg-sc-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Scheme support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-sc-3.scm"
cat <<\EOF > xg-sc-3.scm
; a
(setq string ; b
))
EOF
-tmpfiles="$tmpfiles xg-sc-3.tmp.po xg-sc-3.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
- -d xg-sc-3.tmp xg-sc-3.scm
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-sc-3.tmp.po > xg-sc-3.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-sc-3.tmp xg-sc-3.scm || exit 1
+LC_ALL=C tr -d '\r' < xg-sc-3.tmp.po > xg-sc-3.po || exit 1
-tmpfiles="$tmpfiles xg-sc-3.ok"
cat <<EOF > xg-sc-3.ok
#. a
#. b
${DIFF} xg-sc-3.ok xg-sc-3.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of Shell support.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-sh-1.sh"
cat <<\EOF > xg-sh-1.sh
# Test backslash before normal alphabetic character.
echo "`echo "\`ngettext 'depth_2_11_squote_8_semi \\\\\\\\;'\`"`"
EOF
-tmpfiles="$tmpfiles xg-sh-1.tmp.po xg-sh-1.po"
: ${XGETTEXT=xgettext}
# Here we use ngettext with two signatures: ngettext:1 and ngettext:1,2.
${XGETTEXT} --omit-header --no-location --keyword=ngettext:1 \
- -d xg-sh-1.tmp xg-sh-1.sh
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-sh-1.tmp.po > xg-sh-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-sh-1.tmp xg-sh-1.sh || exit 1
+LC_ALL=C tr -d '\r' < xg-sh-1.tmp.po > xg-sh-1.po || exit 1
-tmpfiles="$tmpfiles xg-sh-1.ok"
cat <<\EOF > xg-sh-1.ok
msgid "depth_0_none_0_x"
msgstr ""
${DIFF} xg-sh-1.ok xg-sh-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Shell support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-sh-2.sh"
cat <<EOF > xg-sh-2.sh
# This comment will not be extracted.
gettext "help"
gettext "The Fabulous Four"
EOF
-tmpfiles="$tmpfiles xg-sh-2.tmp.po xg-sh-2.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-sh-2.tmp xg-sh-2.sh
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-sh-2.tmp.po > xg-sh-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-sh-2.tmp xg-sh-2.sh || exit 1
+LC_ALL=C tr -d '\r' < xg-sh-2.tmp.po > xg-sh-2.po || exit 1
-tmpfiles="$tmpfiles xg-sh-2.ok"
cat <<EOF > xg-sh-2.ok
msgid "help"
msgstr ""
${DIFF} xg-sh-2.ok xg-sh-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Shell support: backslashed double-quotes inside single-quotes.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-sh-3.sh"
cat <<\EOF > xg-sh-3.sh
echo `gettext 'abc\"def'`
EOF
-tmpfiles="$tmpfiles xg-sh-3.tmp.po xg-sh-3.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -d xg-sh-3.tmp xg-sh-3.sh
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-sh-3.tmp.po > xg-sh-3.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -d xg-sh-3.tmp xg-sh-3.sh || exit 1
+LC_ALL=C tr -d '\r' < xg-sh-3.tmp.po > xg-sh-3.po || exit 1
-tmpfiles="$tmpfiles xg-sh-3.ok"
cat <<\EOF > xg-sh-3.ok
msgid "abc\\\"def"
msgstr ""
${DIFF} xg-sh-3.ok xg-sh-3.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of Shell support: obsolete bash $"..." syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-sh-4.sh"
cat <<\EOF > xg-sh-4.sh
# Test backslash before normal alphabetic character.
echo "`echo "\`echo $"depth_2_11_bashquote_8_\\\\\\\\$var"\`"`"
EOF
-tmpfiles="$tmpfiles xg-sh-4.err xg-sh-4.tmp.po xg-sh-4.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location -d xg-sh-4.tmp xg-sh-4.sh 2>xg-sh-4.err
-test $? = 0 || { cat xg-sh-4.err; rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-sh-4.tmp.po > xg-sh-4.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+test $? = 0 || { cat xg-sh-4.err; exit 1; }
+LC_ALL=C tr -d '\r' < xg-sh-4.tmp.po > xg-sh-4.po || exit 1
-tmpfiles="$tmpfiles xg-sh-4.ok"
cat <<\EOF > xg-sh-4.ok
msgid "depth_0_bashquote_0_x"
msgstr ""
${DIFF} xg-sh-4.ok xg-sh-4.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of Shell support: bash $(...) syntax.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-sh-5.sh"
cat <<\EOF > xg-sh-5.sh
echo $(gettext 'Simple string')
echo "$(gettext 'Simple string inside double-quotes')"
echo "$(gettext "Simple decorated dstring: \"x\" \\\"y\\\" inside double-quotes")"
EOF
-tmpfiles="$tmpfiles xg-sh-5.tmp.po xg-sh-5.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -d xg-sh-5.tmp xg-sh-5.sh
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-sh-5.tmp.po > xg-sh-5.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -d xg-sh-5.tmp xg-sh-5.sh || exit 1
+LC_ALL=C tr -d '\r' < xg-sh-5.tmp.po > xg-sh-5.po || exit 1
-tmpfiles="$tmpfiles xg-sh-5.ok"
cat <<\EOF > xg-sh-5.ok
msgid "Simple string"
msgstr ""
${DIFF} xg-sh-5.ok xg-sh-5.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Shell support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-sh-6.sh"
cat <<\EOF > xg-sh-6.sh
# a
_ "hello world" # b
EOF
-tmpfiles="$tmpfiles xg-sh-6.tmp.po xg-sh-6.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
- -d xg-sh-6.tmp xg-sh-6.sh
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-sh-6.tmp.po > xg-sh-6.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-sh-6.tmp xg-sh-6.sh || exit 1
+LC_ALL=C tr -d '\r' < xg-sh-6.tmp.po > xg-sh-6.po || exit 1
-tmpfiles="$tmpfiles xg-sh-6.ok"
cat <<EOF > xg-sh-6.ok
#. a
msgid "hello world"
${DIFF} xg-sh-6.ok xg-sh-6.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Smalltalk support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-st-1.st"
cat <<EOF > xg-st-1.st
"This comment will not be extracted."
Transcript showCr: (NLS ? 'help').
Transcript showCr: (NLS ? 'The Fabulous Four').
EOF
-tmpfiles="$tmpfiles xg-st-1.tmp.po xg-st-1.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-st-1.tmp xg-st-1.st
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-st-1.tmp.po > xg-st-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-st-1.tmp xg-st-1.st || exit 1
+LC_ALL=C tr -d '\r' < xg-st-1.tmp.po > xg-st-1.po || exit 1
-tmpfiles="$tmpfiles xg-st-1.ok"
cat <<EOF > xg-st-1.ok
msgid "help"
msgstr ""
${DIFF} xg-st-1.ok xg-st-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Smalltalk support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-st-2.st"
cat <<\EOF > xg-st-2.st
"a"
"b" Transcript showCr:
"f" 'hello world' "h" ).
EOF
-tmpfiles="$tmpfiles xg-st-2.tmp.po xg-st-2.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location \
- -d xg-st-2.tmp xg-st-2.st
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-st-2.tmp.po > xg-st-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-st-2.tmp xg-st-2.st || exit 1
+LC_ALL=C tr -d '\r' < xg-st-2.tmp.po > xg-st-2.po || exit 1
-tmpfiles="$tmpfiles xg-st-2.ok"
cat <<EOF > xg-st-2.ok
#. a
#. b
${DIFF} xg-st-2.ok xg-st-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test extractor of NeXTstep/GNUstep .strings files.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-stbl-1.strings"
cat <<\EOF > xg-stbl-1.strings
/***
German.lproj/Localizable.strings
= "Dieses Programm läuft mit der Prozess-Nummer %d.";
EOF
-tmpfiles="$tmpfiles xg-stbl-1.tmp xg-stbl-1.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} -o xg-stbl-1.tmp xg-stbl-1.strings
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} -o xg-stbl-1.tmp xg-stbl-1.strings || exit 1
# Don't simplify this to "grep ... < xg-stbl-1.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-stbl-1.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-stbl-1.po
-tmpfiles="$tmpfiles xg-stbl-1.ok"
cat <<\EOF > xg-stbl-1.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-stbl-1.ok xg-stbl-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of Tcl support.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-t-1.tcl"
cat <<\EOF > xg-t-1.tcl
#!/usr/bin/tclsh
}
EOF
-tmpfiles="$tmpfiles xg-t-1.err xg-t-1.tmp xg-t-1.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --no-location -k_ -o xg-t-1.tmp xg-t-1.tcl 2>xg-t-1.err
-test $? = 0 || { cat xg-t-1.err; rm -fr $tmpfiles; exit 1; }
+test $? = 0 || { cat xg-t-1.err; exit 1; }
# Don't simplify this to "grep ... < xg-t-1.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-t-1.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-t-1.pot
-tmpfiles="$tmpfiles xg-t-1.ok"
cat <<\EOF > xg-t-1.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-t-1.ok xg-t-1.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Tcl support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-t-2.tcl"
cat <<EOF > xg-t-2.tcl
# This comment will not be extracted.
puts [_ "help"]
puts [_ "The Fabulous Four"]
EOF
-tmpfiles="$tmpfiles xg-t-2.tmp.po xg-t-2.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: -k_ \
- -d xg-t-2.tmp xg-t-2.tcl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-t-2.tmp.po > xg-t-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-t-2.tmp xg-t-2.tcl || exit 1
+LC_ALL=C tr -d '\r' < xg-t-2.tmp.po > xg-t-2.po || exit 1
-tmpfiles="$tmpfiles xg-t-2.ok"
cat <<EOF > xg-t-2.ok
msgid "help"
msgstr ""
${DIFF} xg-t-2.ok xg-t-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test Tcl support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-t-3.tcl"
cat <<\EOF > xg-t-3.tcl
# a
set string [_ "hello world" # b
] # c
EOF
-tmpfiles="$tmpfiles xg-t-3.tmp.po xg-t-3.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
- -d xg-t-3.tmp xg-t-3.tcl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-t-3.tmp.po > xg-t-3.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-t-3.tmp xg-t-3.tcl || exit 1
+LC_ALL=C tr -d '\r' < xg-t-3.tmp.po > xg-t-3.po || exit 1
-tmpfiles="$tmpfiles xg-t-3.ok"
cat <<EOF > xg-t-3.ok
#. a
msgid "hello world"
${DIFF} xg-t-3.ok xg-t-3.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of Tcl support: escape sequences.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-t-4.tcl"
cat <<\EOF > xg-t-4.tcl
puts [_ "Hello\u200e\u201cWorld\u201d"]
puts [_ "x\u20y\x20z"]
puts [_ "\xFF20"]
EOF
-tmpfiles="$tmpfiles xg-t-4.err xg-t-4.tmp xg-t-4.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --no-location -k_ -o xg-t-4.tmp xg-t-4.tcl 2>xg-t-4.err
-test $? = 0 || { cat xg-t-4.err; rm -fr $tmpfiles; exit 1; }
+test $? = 0 || { cat xg-t-4.err; exit 1; }
# Don't simplify this to "grep ... < xg-t-4.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-t-4.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-t-4.pot
-tmpfiles="$tmpfiles xg-t-4.ok"
cat <<\EOF > xg-t-4.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-t-4.ok xg-t-4.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test of Vala support.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-vala-1.vala"
cat <<\EOF > xg-vala-1.vala
int main (string[] args) {
var s1 = "Simple string, no gettext needed";
}
EOF
-tmpfiles="$tmpfiles xg-vala-1.err xg-vala-1.tmp xg-vala-1.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --no-location -o xg-vala-1.tmp xg-vala-1.vala 2>xg-vala-1.err
-test $? = 0 || { cat xg-vala-1.err; rm -fr $tmpfiles; exit 1; }
+test $? = 0 || { cat xg-vala-1.err; exit 1; }
# Don't simplify this to "grep ... < xg-vala-1.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-vala-1.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-vala-1.pot
-tmpfiles="$tmpfiles xg-vala-1.ok"
cat <<\EOF > xg-vala-1.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-vala-1.ok xg-vala-1.pot
result=$?
-rm -fr $tmpfiles
-
exit $result
# Plural test for YCP
#
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-y-1.ycp"
cat <<EOF > xg-y-1.ycp
title = sformat (_("%1 package", "%1 packages", num), num);
EOF
-tmpfiles="$tmpfiles xg-y-1.tmp.po xg-y-1.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -k:1,2 -d xg-y-1.tmp xg-y-1.ycp
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-y-1.tmp.po > xg-y-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -k:1,2 -d xg-y-1.tmp xg-y-1.ycp || exit 1
+LC_ALL=C tr -d '\r' < xg-y-1.tmp.po > xg-y-1.po || exit 1
-tmpfiles="$tmpfiles xg-y-1.ok"
cat <<EOF > xg-y-1.ok
#, ycp-format
msgid "%1 package"
${DIFF} xg-y-1.ok xg-y-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test YCP support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-y-2.ycp"
cat <<EOF > xg-y-2.ycp
// This comment will not be extracted.
print (_("help"));
print (_("The Fabulous Four"));
EOF
-tmpfiles="$tmpfiles xg-y-2.tmp.po xg-y-2.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
- -d xg-y-2.tmp xg-y-2.ycp
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-y-2.tmp.po > xg-y-2.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-y-2.tmp xg-y-2.ycp || exit 1
+LC_ALL=C tr -d '\r' < xg-y-2.tmp.po > xg-y-2.po || exit 1
-tmpfiles="$tmpfiles xg-y-2.ok"
cat <<EOF > xg-y-2.ok
msgid "help"
msgstr ""
${DIFF} xg-y-2.ok xg-y-2.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test YCP support: string literal concatenation.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-y-3.ycp"
cat <<\EOF > xg-y-3.ycp
print (_("John\n"
"Paul\n"
"Ringo"));
EOF
-tmpfiles="$tmpfiles xg-y-3.tmp.po xg-y-3.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -d xg-y-3.tmp xg-y-3.ycp
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-y-3.tmp.po > xg-y-3.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -d xg-y-3.tmp xg-y-3.ycp || exit 1
+LC_ALL=C tr -d '\r' < xg-y-3.tmp.po > xg-y-3.po || exit 1
-tmpfiles="$tmpfiles xg-y-3.ok"
cat <<\EOF > xg-y-3.ok
msgid ""
"John\n"
${DIFF} xg-y-3.ok xg-y-3.po
result=$?
-rm -fr $tmpfiles
-
exit $result
# Test YCP support: --add-comments option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-y-4.ycp"
cat <<\EOF > xg-y-4.ycp
/* a */
/* b */ string = /* c */
/* e */ _( /* f */ "hello " /* g */ "world" /* h */ );
EOF
-tmpfiles="$tmpfiles xg-y-4.tmp.po xg-y-4.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
- -d xg-y-4.tmp xg-y-4.ycp
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-y-4.tmp.po > xg-y-4.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-y-4.tmp xg-y-4.ycp || exit 1
+LC_ALL=C tr -d '\r' < xg-y-4.tmp.po > xg-y-4.po || exit 1
-tmpfiles="$tmpfiles xg-y-4.ok"
cat <<EOF > xg-y-4.ok
#. a
#. b
${DIFF} xg-y-4.ok xg-y-4.po
result=$?
-rm -fr $tmpfiles
-
exit $result