From: Bruno Haible Date: Sun, 13 Oct 2024 16:28:39 +0000 (+0200) Subject: tests: Reorganize msgmerge tests. X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=a50f793b7f65e3dd97cf8a277073abf7af41e22f;p=thirdparty%2Fgettext.git tests: Reorganize msgmerge tests. * gettext-tools/tests/msgmerge-9: Renamed from gettext-tools/tests/msgmerge-18. * gettext-tools/tests/msgmerge-10: Renamed from gettext-tools/tests/msgmerge-19. * gettext-tools/tests/msgmerge-11: Renamed from gettext-tools/tests/msgmerge-20. * gettext-tools/tests/msgmerge-12: Renamed from gettext-tools/tests/msgmerge-25. * gettext-tools/tests/msgmerge-13: Renamed from gettext-tools/tests/msgmerge-26. * gettext-tools/tests/msgmerge-14: Renamed from gettext-tools/tests/msgmerge-27. * gettext-tools/tests/msgmerge-15: Renamed from gettext-tools/tests/msgmerge-29. * gettext-tools/tests/Makefile.am (TESTS): Update. --- diff --git a/gettext-tools/tests/Makefile.am b/gettext-tools/tests/Makefile.am index ed10d8b1d..34ba7b78f 100644 --- a/gettext-tools/tests/Makefile.am +++ b/gettext-tools/tests/Makefile.am @@ -62,8 +62,8 @@ TESTS = gettext-1 gettext-2 \ msggrep-8 msggrep-9 msggrep-10 msggrep-11 \ msginit-1 msginit-2 msginit-3 msginit-4 \ msgmerge-1 msgmerge-2 msgmerge-3 msgmerge-4 msgmerge-5 msgmerge-6 \ - msgmerge-7 msgmerge-8 msgmerge-18 msgmerge-19 msgmerge-20 msgmerge-25 \ - msgmerge-26 msgmerge-27 msgmerge-29 \ + msgmerge-7 msgmerge-8 msgmerge-9 msgmerge-10 msgmerge-11 msgmerge-12 \ + msgmerge-13 msgmerge-14 msgmerge-15 \ msgmerge-charset-1 msgmerge-charset-2 msgmerge-charset-3 \ msgmerge-compendium-1 msgmerge-compendium-2 msgmerge-compendium-3 \ msgmerge-compendium-4 msgmerge-compendium-5 msgmerge-compendium-6 \ diff --git a/gettext-tools/tests/msgmerge-19 b/gettext-tools/tests/msgmerge-10 similarity index 88% rename from gettext-tools/tests/msgmerge-19 rename to gettext-tools/tests/msgmerge-10 index 4b3119ead..53d92325e 100755 --- a/gettext-tools/tests/msgmerge-19 +++ b/gettext-tools/tests/msgmerge-10 @@ -3,7 +3,7 @@ # Test msgmerge --previous option. -cat <<\EOF > mm-test19.po +cat <<\EOF > mm-test10.po msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" @@ -28,7 +28,7 @@ msgid "%s: invalid option -- %c\n" msgstr "%s: ungültige Option -- %c\n" EOF -cat <<\EOF > mm-test19.pot +cat <<\EOF > mm-test10.pot # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. @@ -77,10 +77,10 @@ msgstr "" EOF : ${MSGMERGE=msgmerge} -${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 +${MSGMERGE} -q --previous -o mm-test10.tmp.po mm-test10.po mm-test10.pot || Exit 1 +LC_ALL=C tr -d '\r' < mm-test10.tmp.po > mm-test10.new1.po || Exit 1 -cat <<\EOF > mm-test19.ok1 +cat <<\EOF > mm-test10.ok1 msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" @@ -120,9 +120,9 @@ msgstr "%s: ungültige Option -- %c\n" EOF : ${DIFF=diff} -${DIFF} mm-test19.ok1 mm-test19.new1.po || Exit 1 +${DIFF} mm-test10.ok1 mm-test10.new1.po || Exit 1 -cat <<\EOF > mm-test19.pot +cat <<\EOF > mm-test10.pot # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. @@ -161,10 +161,10 @@ msgstr "" EOF : ${MSGMERGE=msgmerge} -${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 +${MSGMERGE} -q --previous -o mm-test10.tmp.po mm-test10.new1.po mm-test10.pot || Exit 1 +LC_ALL=C tr -d '\r' < mm-test10.tmp.po > mm-test10.new2.po || Exit 1 -cat <<\EOF > mm-test19.ok2 +cat <<\EOF > mm-test10.ok2 msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" @@ -204,6 +204,6 @@ msgstr "Argumente fehlen" EOF : ${DIFF=diff} -${DIFF} mm-test19.ok2 mm-test19.new2.po || Exit 1 +${DIFF} mm-test10.ok2 mm-test10.new2.po || Exit 1 Exit 0 diff --git a/gettext-tools/tests/msgmerge-20 b/gettext-tools/tests/msgmerge-11 similarity index 90% rename from gettext-tools/tests/msgmerge-20 rename to gettext-tools/tests/msgmerge-11 index 5985fa877..8919585c7 100755 --- a/gettext-tools/tests/msgmerge-20 +++ b/gettext-tools/tests/msgmerge-11 @@ -4,7 +4,7 @@ # Test msgmerge when the second argument is a PO file with obsolete messages # (e.g. the result of an earlier msgmerge operation). -cat <<\EOF > mm-test20.po +cat <<\EOF > mm-test11.po msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" @@ -32,7 +32,7 @@ msgid "This program is running as process number {pid}." msgstr "Dieses Programm läuft mit der Prozeß-Nummer {pid}." EOF -cat <<\EOF > mm-test20.pot +cat <<\EOF > mm-test11.pot #, fuzzy msgid "" msgstr "" @@ -72,10 +72,10 @@ msgstr "" EOF : ${MSGMERGE=msgmerge} -${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 +${MSGMERGE} -q -o mm-test11.tmp.po mm-test11.po mm-test11.pot || Exit 1 +LC_ALL=C tr -d '\r' < mm-test11.tmp.po > mm-test11.new.po || Exit 1 -cat <<\EOF > mm-test20.ok +cat <<\EOF > mm-test11.ok msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" @@ -109,6 +109,6 @@ msgstr "" EOF : ${DIFF=diff} -${DIFF} mm-test20.ok mm-test20.new.po || Exit 1 +${DIFF} mm-test11.ok mm-test11.new.po || Exit 1 Exit 0 diff --git a/gettext-tools/tests/msgmerge-25 b/gettext-tools/tests/msgmerge-12 similarity index 78% rename from gettext-tools/tests/msgmerge-25 rename to gettext-tools/tests/msgmerge-12 index b19ac6de8..d11b83f0a 100755 --- a/gettext-tools/tests/msgmerge-25 +++ b/gettext-tools/tests/msgmerge-12 @@ -3,7 +3,7 @@ # Test --add-location=file option. -cat <<\EOF > mm-test25.in1 +cat <<\EOF > mm-test12.in1 # first #. this should be discarded msgid "1" @@ -20,7 +20,7 @@ msgid "3" msgstr "3z" EOF -cat <<\EOF > mm-test25.in2 +cat <<\EOF > mm-test12.in2 #. this is the first #: snark.c:345 msgid "1" @@ -36,11 +36,11 @@ msgstr "" EOF : ${MSGMERGE=msgmerge} -${MSGMERGE} --add-location=file -q -o mm-test25.tmp mm-test25.in1 mm-test25.in2 \ +${MSGMERGE} --add-location=file -q -o mm-test12.tmp mm-test12.in1 mm-test12.in2 \ || Exit 1 -LC_ALL=C tr -d '\r' < mm-test25.tmp > mm-test25.out || Exit 1 +LC_ALL=C tr -d '\r' < mm-test12.tmp > mm-test12.out || Exit 1 -cat << EOF > mm-test25.ok +cat << EOF > mm-test12.ok # first #. this is the first #: snark.c @@ -63,7 +63,7 @@ msgstr "3z" EOF : ${DIFF=diff} -${DIFF} mm-test25.ok mm-test25.out +${DIFF} mm-test12.ok mm-test12.out result=$? exit $result diff --git a/gettext-tools/tests/msgmerge-26 b/gettext-tools/tests/msgmerge-13 similarity index 70% rename from gettext-tools/tests/msgmerge-26 rename to gettext-tools/tests/msgmerge-13 index 1b7f80959..a29a41729 100755 --- a/gettext-tools/tests/msgmerge-26 +++ b/gettext-tools/tests/msgmerge-13 @@ -3,7 +3,7 @@ # Test --for-msgfmt option. -cat <<\EOF > mm-test26.in1 +cat <<\EOF > mm-test13.in1 #: fruits.c:14 msgid "cherry" msgstr "cerise" @@ -22,7 +22,7 @@ msgid "apple" msgstr "pommes" EOF -cat <<\EOF > mm-test26.in2 +cat <<\EOF > mm-test13.in2 # Fuzzy already in the PO file. #: fruits.c:10 msgid "apple" @@ -60,11 +60,11 @@ msgstr "Papaya" EOF : ${MSGMERGE=msgmerge} -${MSGMERGE} --for-msgfmt -o mm-test26.tmp mm-test26.in1 mm-test26.in2 \ +${MSGMERGE} --for-msgfmt -o mm-test13.tmp mm-test13.in1 mm-test13.in2 \ || Exit 1 -LC_ALL=C tr -d '\r' < mm-test26.tmp > mm-test26.out || Exit 1 +LC_ALL=C tr -d '\r' < mm-test13.tmp > mm-test13.out || Exit 1 -cat << EOF > mm-test26.ok +cat << EOF > mm-test13.ok msgid "pear" msgstr "poire" @@ -73,11 +73,11 @@ msgstr "Papaya" EOF : ${DIFF=diff} -${DIFF} mm-test26.ok mm-test26.out || Exit 1 +${DIFF} mm-test13.ok mm-test13.out || Exit 1 # Test with a PO file that has no translated messages. -cat <<\EOF > mm-test26a.in1 +cat <<\EOF > mm-test13a.in1 msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" @@ -86,7 +86,7 @@ msgid "Hello world" msgstr "Hallo Welt" EOF -cat <<\EOF > mm-test26a.in2 +cat <<\EOF > mm-test13a.in2 msgid "" msgstr "" "Content-Type: text/plain; charset=ASCII\n" @@ -96,14 +96,14 @@ msgstr "" EOF : ${MSGMERGE=msgmerge} -${MSGMERGE} --for-msgfmt -o mm-test26a.tmp mm-test26a.in1 mm-test26a.in2 \ +${MSGMERGE} --for-msgfmt -o mm-test13a.tmp mm-test13a.in1 mm-test13a.in2 \ || Exit 1 -LC_ALL=C tr -d '\r' < mm-test26a.tmp > mm-test26a.out || Exit 1 +LC_ALL=C tr -d '\r' < mm-test13a.tmp > mm-test13a.out || Exit 1 -cat <<\EOF > mm-test26a.ok +cat <<\EOF > mm-test13a.ok msgid "" msgstr "Content-Type: text/plain; charset=UTF-8\n" EOF : ${DIFF=diff} -${DIFF} mm-test26a.ok mm-test26a.out || Exit 1 +${DIFF} mm-test13a.ok mm-test13a.out || Exit 1 diff --git a/gettext-tools/tests/msgmerge-27 b/gettext-tools/tests/msgmerge-14 similarity index 88% rename from gettext-tools/tests/msgmerge-27 rename to gettext-tools/tests/msgmerge-14 index e8076ee2c..4317fd16b 100755 --- a/gettext-tools/tests/msgmerge-27 +++ b/gettext-tools/tests/msgmerge-14 @@ -4,7 +4,7 @@ # Test that the msgmerge output is stable under an 'msgcat' invocation. # Also test what happens with the 'no-wrap' flag during msgmerge. -cat <<\EOF > mm-test27.po +cat <<\EOF > mm-test14.po msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" @@ -25,7 +25,7 @@ msgid "This is another long paragraph that does not get wrapped into several lin msgstr "Dies ist ein weiterer langer Abschnitt, der nicht in mehrere Zeilen umgebrochen wird, weil er als 'no-wrap' markiert ist." EOF -cat <<\EOF > mm-test27-1.pot +cat <<\EOF > mm-test14-1.pot #, fuzzy msgid "" msgstr "" @@ -47,17 +47,17 @@ msgstr "" EOF : ${MSGMERGE=msgmerge} -${MSGMERGE} -q -o mm-test27.tmp.po mm-test27.po mm-test27-1.pot || Exit 1 -LC_ALL=C tr -d '\r' < mm-test27.tmp.po > mm-test27.new.po || Exit 1 +${MSGMERGE} -q -o mm-test14.tmp.po mm-test14.po mm-test14-1.pot || Exit 1 +LC_ALL=C tr -d '\r' < mm-test14.tmp.po > mm-test14.new.po || Exit 1 : ${MSGCAT=msgcat} -${MSGCAT} mm-test27.new.po > mm-test27.tmp.po || Exit 1 -LC_ALL=C tr -d '\r' < mm-test27.tmp.po > mm-test27.cat.po || Exit 1 +${MSGCAT} mm-test14.new.po > mm-test14.tmp.po || Exit 1 +LC_ALL=C tr -d '\r' < mm-test14.tmp.po > mm-test14.cat.po || Exit 1 : ${DIFF=diff} -${DIFF} mm-test27.new.po mm-test27.cat.po || Exit 1 +${DIFF} mm-test14.new.po mm-test14.cat.po || Exit 1 -cat <<\EOF > mm-test27-1.ok +cat <<\EOF > mm-test14-1.ok msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" @@ -88,12 +88,12 @@ msgstr "Dies ist ein langer Abschnitt, der nicht in mehrere Zeilen umgebrochen w EOF : ${DIFF=diff} -${DIFF} mm-test27-1.ok mm-test27.new.po || Exit 1 +${DIFF} mm-test14-1.ok mm-test14.new.po || Exit 1 # Now test what happens with the 'no-wrap' flag when merging with a POT file # where the 'no-wrap' flag is set. -cat <<\EOF > mm-test27-2.pot +cat <<\EOF > mm-test14-2.pot #, fuzzy msgid "" msgstr "" @@ -124,10 +124,10 @@ msgstr "" EOF : ${MSGMERGE=msgmerge} -${MSGMERGE} -q -o mm-test27.tmp.po mm-test27.new.po mm-test27-2.pot || Exit 1 -LC_ALL=C tr -d '\r' < mm-test27.tmp.po > mm-test27-2.po || Exit 1 +${MSGMERGE} -q -o mm-test14.tmp.po mm-test14.new.po mm-test14-2.pot || Exit 1 +LC_ALL=C tr -d '\r' < mm-test14.tmp.po > mm-test14-2.po || Exit 1 -cat <<\EOF > mm-test27-2.ok +cat <<\EOF > mm-test14-2.ok msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" @@ -152,12 +152,12 @@ msgstr "Dies ist ein weiterer langer Abschnitt, der nicht in mehrere Zeilen umge EOF : ${DIFF=diff} -${DIFF} mm-test27-2.ok mm-test27-2.po || Exit 1 +${DIFF} mm-test14-2.ok mm-test14-2.po || Exit 1 # Now test what happens with the 'no-wrap' flag when merging with a POT file # where the 'no-wrap' flag is absent. -cat <<\EOF > mm-test27-3.pot +cat <<\EOF > mm-test14-3.pot #, fuzzy msgid "" msgstr "" @@ -184,10 +184,10 @@ msgstr "" EOF : ${MSGMERGE=msgmerge} -${MSGMERGE} -q -o mm-test27.tmp.po mm-test27.new.po mm-test27-3.pot || Exit 1 -LC_ALL=C tr -d '\r' < mm-test27.tmp.po > mm-test27-3.po || Exit 1 +${MSGMERGE} -q -o mm-test14.tmp.po mm-test14.new.po mm-test14-3.pot || Exit 1 +LC_ALL=C tr -d '\r' < mm-test14.tmp.po > mm-test14-3.po || Exit 1 -cat <<\EOF > mm-test27-3.ok +cat <<\EOF > mm-test14-3.ok msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" @@ -224,6 +224,6 @@ msgstr "" EOF : ${DIFF=diff} -${DIFF} mm-test27-3.ok mm-test27-3.po || Exit 1 +${DIFF} mm-test14-3.ok mm-test14-3.po || Exit 1 Exit 0 diff --git a/gettext-tools/tests/msgmerge-15 b/gettext-tools/tests/msgmerge-15 new file mode 100755 index 000000000..25b5eeae2 --- /dev/null +++ b/gettext-tools/tests/msgmerge-15 @@ -0,0 +1,49 @@ +#! /bin/sh +. "${srcdir=.}/init.sh"; path_prepend_ . ../src + +# Test --sort-by-file option, when no file positions are present. + +cat <<\EOF > mm-test15.po +msgid "a" +msgstr "a" + +#~ msgid "c" +#~ msgstr "c" + +#~ msgid "d" +#~ msgstr "d" + +#~ msgid "b" +#~ msgstr "b" +EOF + +cat <<\EOF > mm-test15.pot +msgid "a" +msgstr "" +EOF + +: ${MSGMERGE=msgmerge} +${MSGMERGE} -q --sort-by-file -o mm-test15.tmp mm-test15.po mm-test15.pot || Exit 1 +LC_ALL=C tr -d '\r' < mm-test15.tmp > mm-test15.po2 || Exit 1 +${MSGMERGE} -q --sort-by-file -o mm-test15.tmp mm-test15.po2 mm-test15.pot || Exit 1 +LC_ALL=C tr -d '\r' < mm-test15.tmp > mm-test15.po3 || Exit 1 + +cat <<\EOF > mm-test15.ok +msgid "a" +msgstr "a" + +#~ msgid "b" +#~ msgstr "b" + +#~ msgid "c" +#~ msgstr "c" + +#~ msgid "d" +#~ msgstr "d" +EOF + +: ${DIFF=diff} +${DIFF} mm-test15.ok mm-test15.po2 || Exit 1 +${DIFF} mm-test15.ok mm-test15.po3 || Exit 1 + +Exit 0 diff --git a/gettext-tools/tests/msgmerge-29 b/gettext-tools/tests/msgmerge-29 deleted file mode 100755 index 91298382b..000000000 --- a/gettext-tools/tests/msgmerge-29 +++ /dev/null @@ -1,49 +0,0 @@ -#! /bin/sh -. "${srcdir=.}/init.sh"; path_prepend_ . ../src - -# Test --sort-by-file option, when no file positions are present. - -cat <<\EOF > mm-test29.po -msgid "a" -msgstr "a" - -#~ msgid "c" -#~ msgstr "c" - -#~ msgid "d" -#~ msgstr "d" - -#~ msgid "b" -#~ msgstr "b" -EOF - -cat <<\EOF > mm-test29.pot -msgid "a" -msgstr "" -EOF - -: ${MSGMERGE=msgmerge} -${MSGMERGE} -q --sort-by-file -o mm-test29.tmp mm-test29.po mm-test29.pot || Exit 1 -LC_ALL=C tr -d '\r' < mm-test29.tmp > mm-test29.po2 || Exit 1 -${MSGMERGE} -q --sort-by-file -o mm-test29.tmp mm-test29.po2 mm-test29.pot || Exit 1 -LC_ALL=C tr -d '\r' < mm-test29.tmp > mm-test29.po3 || Exit 1 - -cat <<\EOF > mm-test29.ok -msgid "a" -msgstr "a" - -#~ msgid "b" -#~ msgstr "b" - -#~ msgid "c" -#~ msgstr "c" - -#~ msgid "d" -#~ msgstr "d" -EOF - -: ${DIFF=diff} -${DIFF} mm-test29.ok mm-test29.po2 || Exit 1 -${DIFF} mm-test29.ok mm-test29.po3 || Exit 1 - -Exit 0 diff --git a/gettext-tools/tests/msgmerge-18 b/gettext-tools/tests/msgmerge-9 similarity index 87% rename from gettext-tools/tests/msgmerge-18 rename to gettext-tools/tests/msgmerge-9 index ef0f6d64e..31b7cdad7 100755 --- a/gettext-tools/tests/msgmerge-18 +++ b/gettext-tools/tests/msgmerge-9 @@ -3,7 +3,7 @@ # Test msgmerge and msgcmp on a PO file with contexts. -cat <<\EOF > mm-test18.po +cat <<\EOF > mm-test9.po msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" @@ -48,7 +48,7 @@ msgid "copier" msgstr "photocopieur" EOF -cat <<\EOF > mm-test18.pot +cat <<\EOF > mm-test9.pot # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. @@ -113,16 +113,16 @@ msgstr "" EOF : ${MSGCMP=msgcmp} -${MSGCMP} --use-fuzzy --use-untranslated mm-test18.po mm-test18.pot 2>/dev/null +${MSGCMP} --use-fuzzy --use-untranslated mm-test9.po mm-test9.pot 2>/dev/null test $? = 1 || { Exit 1; } : ${MSGMERGE=msgmerge} -${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 +${MSGMERGE} -q -o mm-test9.tmp.po mm-test9.po mm-test9.pot || Exit 1 +LC_ALL=C tr -d '\r' < mm-test9.tmp.po > mm-test9.new.po || Exit 1 # 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 +cat <<\EOF > mm-test9.ok msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" @@ -186,9 +186,9 @@ msgstr "photocopieur" EOF : ${DIFF=diff} -${DIFF} mm-test18.ok mm-test18.new.po || Exit 1 +${DIFF} mm-test9.ok mm-test9.new.po || Exit 1 : ${MSGCMP=msgcmp} -${MSGCMP} --use-fuzzy --use-untranslated mm-test18.new.po mm-test18.pot || Exit 1 +${MSGCMP} --use-fuzzy --use-untranslated mm-test9.new.po mm-test9.pot || Exit 1 Exit 0