Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / msgcmp-4
1 #! /bin/sh
2
3 # Test comparison with PO files with previous msgids.
4 # Test --use-fuzzy option.
5
6 tmpfiles=""
7 trap 'rm -fr $tmpfiles' 1 2 3 15
8
9 tmpfiles="$tmpfiles mc-test4.pot"
10 cat <<\EOF > mc-test4.pot
11 # SOME DESCRIPTIVE TITLE.
12 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
13 # This file is distributed under the same license as the PACKAGE package.
14 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
15 #
16 #, fuzzy
17 msgid ""
18 msgstr ""
19 "Project-Id-Version: PACKAGE VERSION\n"
20 "Report-Msgid-Bugs-To: \n"
21 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
22 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
23 "Language-Team: LANGUAGE <LL@li.org>\n"
24 "MIME-Version: 1.0\n"
25 "Content-Type: text/plain; charset=UTF-8\n"
26 "Content-Transfer-Encoding: 8bit\n"
27
28 #. TRANSLATORS: An error message.
29 #: src/args.c:242
30 #, c-format
31 msgid "Too many arguments."
32 msgstr ""
33
34 #. TRANSLATORS: An error message.
35 #: src/args.c:247
36 #, c-format
37 msgid "Too few arguments."
38 msgstr ""
39
40 # Oder besser "fehlende Argumente"?
41 #. TRANSLATORS: An error message.
42 #: src/args.c:273
43 #, c-format
44 msgid "Missing arguments."
45 msgstr ""
46 EOF
47
48 tmpfiles="$tmpfiles mc-test4.po1"
49 cat <<\EOF > mc-test4.po1
50 msgid ""
51 msgstr ""
52 "Report-Msgid-Bugs-To: \n"
53 "Content-Type: text/plain; charset=UTF-8\n"
54 "Content-Transfer-Encoding: 8bit\n"
55
56 #. TRANSLATORS: An error message.
57 #: src/args.c:242
58 #, fuzzy, c-format
59 #| msgid "too many arguments"
60 msgid "Too many arguments."
61 msgstr "zu viele Argumente"
62
63 #. TRANSLATORS: An error message.
64 #: src/args.c:247
65 #, fuzzy, c-format
66 #| msgid "too many arguments"
67 msgid "Too few arguments."
68 msgstr "zu viele Argumente"
69
70 # Oder besser "fehlende Argumente"?
71 #. TRANSLATORS: An error message.
72 #: src/args.c:273
73 #, fuzzy, c-format
74 #| msgid "missing arguments"
75 msgid "Missing arguments."
76 msgstr "Argumente fehlen"
77
78 #: getopt.c:796 getopt.c:799
79 #, fuzzy, c-format
80 #| msgid "%s: invalid option -- %c\n"
81 msgid "%s: illegal option -- %c\n"
82 msgstr "%s: ungültige Option -- %c\n"
83
84 #: getopt.c:805 getopt.c:808
85 #, c-format
86 msgid "%s: invalid option -- %c\n"
87 msgstr "%s: ungültige Option -- %c\n"
88 EOF
89
90 # Verify that with fuzzies, all msgids of the POT file are covered.
91 tmpfiles="$tmpfiles mc-test4.out11"
92 : ${MSGCMP=msgcmp}
93 LC_MESSAGES=C LC_ALL= \
94 ${MSGCMP} --use-fuzzy mc-test4.po1 mc-test4.pot > mc-test4.out11 2>&1
95 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
96 if grep -v 'warning:' mc-test4.out11 > /dev/null; then
97   rm -fr $tmpfiles; exit 1;
98 fi
99
100 # Verify that without fuzzies, not all msgids of the POT file are covered.
101 tmpfiles="$tmpfiles mc-test4.out12"
102 : ${MSGCMP=msgcmp}
103 LC_MESSAGES=C LC_ALL= \
104 ${MSGCMP} mc-test4.po1 mc-test4.pot > mc-test4.out12 2>&1
105 test $? = 1 || { rm -fr $tmpfiles; exit 1; }
106 grep -v 'warning:' mc-test4.out12 > /dev/null
107 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
108
109 tmpfiles="$tmpfiles mc-test4.po2"
110 cat <<\EOF > mc-test4.po2
111 msgid ""
112 msgstr ""
113 "Report-Msgid-Bugs-To: \n"
114 "Content-Type: text/plain; charset=UTF-8\n"
115 "Content-Transfer-Encoding: 8bit\n"
116
117 #. TRANSLATORS: An error message.
118 #: src/args.c:242
119 #, c-format
120 #| msgid "too many arguments"
121 msgid "Too many arguments."
122 msgstr "Zu viele Argumente."
123
124 #. TRANSLATORS: An error message.
125 #: src/args.c:247
126 #, c-format
127 #| msgid "too many arguments"
128 msgid "Too few arguments."
129 msgstr "Zu wenige Argumente."
130
131 # Oder besser "fehlende Argumente"?
132 #. TRANSLATORS: An error message.
133 #: src/args.c:273
134 #, c-format
135 #| msgid "missing arguments"
136 msgid "Missing arguments."
137 msgstr "Argumente fehlen."
138
139 #: getopt.c:796 getopt.c:799
140 #, fuzzy, c-format
141 #| msgid "%s: invalid option -- %c\n"
142 msgid "%s: illegal option -- %c\n"
143 msgstr "%s: ungültige Option -- %c\n"
144
145 #: getopt.c:805 getopt.c:808
146 #, c-format
147 msgid "%s: invalid option -- %c\n"
148 msgstr "%s: ungültige Option -- %c\n"
149 EOF
150
151 # Verify that without fuzzies, all msgids of the POT file are covered.
152 # Verify that previous msgids are ignored even when specified on non-fuzzy
153 # messages.
154 tmpfiles="$tmpfiles mc-test4.out2"
155 : ${MSGCMP=msgcmp}
156 LC_MESSAGES=C LC_ALL= \
157 ${MSGCMP} mc-test4.po2 mc-test4.pot > mc-test4.out2 2>&1
158 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
159 if grep -v 'warning:' mc-test4.out2 > /dev/null; then
160   rm -fr $tmpfiles; exit 1;
161 fi
162
163 rm -fr $tmpfiles
164
165 exit $result