No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / xgettext-6
blob51f04d413795eea5d6afc24fbcf2c04ecdb2b7b2
1 #!/bin/sh
3 # Test of position dependent recognition of format strings.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles xg-test6.c"
9 cat <<\EOF > xg-test6.c
10 fprintf (fp, gettext ("c-format positive1"), gettext ("c-format negative1"));
11 printk (gettext ("c-format negative2"));
12 EOF
14 tmpfiles="$tmpfiles xg-test6.sh"
15 cat <<\EOF > xg-test6.sh
16 eval_gettext "sh-format positive1" "`gettext \"sh-format negative1\"`"
17 echo "`gettext \"sh-format negative2\"`"
18 EOF
20 tmpfiles="$tmpfiles xg-test6.py"
21 cat <<\EOF > xg-test6.py
22 my_printf (gettext ("python-format positive1"),
23 gettext ("python-format negative1"));
24 printk (gettext ("python-format negative2"));
25 EOF
27 tmpfiles="$tmpfiles xg-test6.lisp"
28 cat <<\EOF > xg-test6.lisp
29 (format t (gettext "lisp-format positive1") (gettext "lisp-format negative1"))
30 (prin1 (gettext "lisp-format negative2"))
31 EOF
33 tmpfiles="$tmpfiles xg-test6.el"
34 cat <<\EOF > xg-test6.el
35 (format (_ "elisp-format positive1") (_ "elisp-format negative1"))
36 (printk (_ "elisp-format negative2"))
37 EOF
39 tmpfiles="$tmpfiles xg-test6.jl"
40 cat <<\EOF > xg-test6.jl
41 (format stream (_ "librep-format positive1") (_ "librep-format negative1"))
42 (printk (_ "librep-format negative2"))
43 EOF
45 tmpfiles="$tmpfiles xg-test6.java"
46 cat <<\EOF > xg-test6.java
47 MessageFormat.format(gettext("java-format positive1"),
48 gettext("java-format negative1"));
49 System.err.println(gettext("java-format negative2"));
50 EOF
52 tmpfiles="$tmpfiles xg-test6.awk"
53 cat <<\EOF > xg-test6.awk
54 printf dcgettext ("awk-format positive1"), dcgettext ("awk-format negative1");
55 printf (dcgettext ("awk-format positive2"), dcgettext ("awk-format negative2"));
56 printf dcgettext ("awk-format positive3"); dcgettext ("awk-format negative3");
57 printk dcgettext ("awk-format negative4");
58 EOF
60 tmpfiles="$tmpfiles xg-test6.ycp"
61 cat <<\EOF > xg-test6.ycp
62 sformat (_("ycp-format positive1"), _("ycp-format negative1"));
63 printk (_("ycp-format negative2"));
64 EOF
66 tmpfiles="$tmpfiles xg-test6.tcl"
67 cat <<\EOF > xg-test6.tcl
68 [format [::msgcat::mc "tcl-format positive1"]
69 [::msgcat::mc "tcl-format negative1"]]
70 [print [::msgcat::mc "tcl-format negative2"]]
71 EOF
73 tmpfiles="$tmpfiles xg-test6.pl"
74 cat <<\EOF > xg-test6.pl
75 printf gettext "perl-format positive1", gettext ("perl-format negative1");
76 gettext ("perl-format negative2");
77 printf gettext "perl-format positive2"; gettext ("perl-format negative3");
78 gettext ("perl-format negative4");
79 print sprintf gettext "perl-format positive3";
80 print kprintf gettext "perl-format negative5";
81 EOF
83 tmpfiles="$tmpfiles xg-test6.php"
84 cat <<\EOF > xg-test6.php
85 <? php
86 printf (_ ("php-format positive1"), _ ("php-format negative1"));
87 printk (_ ("php-format negative2"));
88 EOF
90 tmpfiles="$tmpfiles xg-test6.po"
91 : ${XGETTEXT=xgettext}
92 ${XGETTEXT} --omit-header --no-location -d xg-test6 \
93 --flag=my_printf:1:python-format \
94 xg-test6.c xg-test6.sh xg-test6.py xg-test6.lisp xg-test6.el \
95 xg-test6.jl xg-test6.java xg-test6.awk xg-test6.ycp xg-test6.tcl \
96 xg-test6.pl xg-test6.php
97 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
99 tmpfiles="$tmpfiles xg-test6.ok"
100 cat <<\EOF > xg-test6.ok
101 #, c-format
102 msgid "c-format positive1"
103 msgstr ""
105 msgid "c-format negative1"
106 msgstr ""
108 msgid "c-format negative2"
109 msgstr ""
111 #, sh-format
112 msgid "sh-format positive1"
113 msgstr ""
115 msgid "sh-format negative1"
116 msgstr ""
118 msgid "sh-format negative2"
119 msgstr ""
121 #, python-format
122 msgid "python-format positive1"
123 msgstr ""
125 msgid "python-format negative1"
126 msgstr ""
128 msgid "python-format negative2"
129 msgstr ""
131 #, lisp-format
132 msgid "lisp-format positive1"
133 msgstr ""
135 msgid "lisp-format negative1"
136 msgstr ""
138 msgid "lisp-format negative2"
139 msgstr ""
141 #, elisp-format
142 msgid "elisp-format positive1"
143 msgstr ""
145 msgid "elisp-format negative1"
146 msgstr ""
148 msgid "elisp-format negative2"
149 msgstr ""
151 #, librep-format
152 msgid "librep-format positive1"
153 msgstr ""
155 msgid "librep-format negative1"
156 msgstr ""
158 msgid "librep-format negative2"
159 msgstr ""
161 #, java-format
162 msgid "java-format positive1"
163 msgstr ""
165 msgid "java-format negative1"
166 msgstr ""
168 msgid "java-format negative2"
169 msgstr ""
171 #, awk-format
172 msgid "awk-format positive1"
173 msgstr ""
175 msgid "awk-format negative1"
176 msgstr ""
178 #, awk-format
179 msgid "awk-format positive2"
180 msgstr ""
182 msgid "awk-format negative2"
183 msgstr ""
185 #, awk-format
186 msgid "awk-format positive3"
187 msgstr ""
189 msgid "awk-format negative3"
190 msgstr ""
192 msgid "awk-format negative4"
193 msgstr ""
195 #, ycp-format
196 msgid "ycp-format positive1"
197 msgstr ""
199 msgid "ycp-format negative1"
200 msgstr ""
202 msgid "ycp-format negative2"
203 msgstr ""
205 #, tcl-format
206 msgid "tcl-format positive1"
207 msgstr ""
209 msgid "tcl-format negative1"
210 msgstr ""
212 msgid "tcl-format negative2"
213 msgstr ""
215 #, perl-format
216 msgid "perl-format positive1"
217 msgstr ""
219 msgid "perl-format negative1"
220 msgstr ""
222 msgid "perl-format negative2"
223 msgstr ""
225 #, perl-format
226 msgid "perl-format positive2"
227 msgstr ""
229 msgid "perl-format negative3"
230 msgstr ""
232 msgid "perl-format negative4"
233 msgstr ""
235 #, perl-format
236 msgid "perl-format positive3"
237 msgstr ""
239 msgid "perl-format negative5"
240 msgstr ""
242 #, php-format
243 msgid "php-format positive1"
244 msgstr ""
246 msgid "php-format negative1"
247 msgstr ""
249 msgid "php-format negative2"
250 msgstr ""
253 : ${DIFF=diff}
254 ${DIFF} xg-test6.ok xg-test6.po
255 result=$?
257 rm -fr $tmpfiles
259 exit $result