Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgexec-1
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test of an external command.
5
6 cat <<\EOF > mex-test1.po
7 # HEADER.
8 #
9 msgid ""
10 msgstr ""
11 "Project-Id-Version: Bonnie Tyler\n"
12 "Content-Type: text/plain; charset=ISO-8859-1\n"
13 "Content-Transfer-Encoding: 8bit\n"
14
15 #: married-men:4
16 #, fuzzy
17 msgid "The world is full of married men"
18 msgstr "So viele verheiratete Männer"
19
20 #: married-men:5
21 msgid "with wives who never understand"
22 msgstr "und ihre Frauen verstehen sie nicht"
23
24 #: married-men:6
25 msgid "They're looking for someone to share"
26 msgstr ""
27
28 # schwer zu übersetzen...
29 #: married-men:7
30 msgid "the excitement of a love affair"
31 msgstr ""
32
33 #: married-men:8
34 msgid "Just as soon as they find you"
35 msgstr ""
36
37 #: married-men:9
38 msgid "They warn you and darn you"
39 msgstr ""
40
41 #~ msgid "You fly on the wings of romance"
42 #~ msgstr "Die Flügel der frischen Liebe\n"
43 #~ "heben dich zum Himmel"
44
45 #, fuzzy
46 #~ msgid "In the eyes of the world"
47 #~ msgstr "Für die anderen"
48
49 # Etwas freie Übersetzung.
50 #~ msgid "You're just another crazy girl"
51 #~ msgstr "bist du bloß ein verrücktes dummes Ding"
52
53 #~ msgid "Who loves a married man"
54 #~ msgstr "das einen verheirateten Mann liebt"
55 EOF
56
57 cat <<\EOF > mex-test1.sh
58 #! /bin/sh
59 echo "========================= $MSGEXEC_LOCATION =========================" | LC_ALL=C tr -d '\r'
60 cat <<MEOF
61 $MSGEXEC_MSGID
62 ---
63 MEOF
64 cat
65 echo | LC_ALL=C tr -d '\r'
66 exit 0
67 EOF
68 chmod a+x mex-test1.sh
69
70 : ${MSGEXEC=msgexec}
71 LC_ALL=C \
72 ${MSGEXEC} -i mex-test1.po ./mex-test1.sh > mex-test1.out 2> mex-test1.err
73 result=$?
74 cat mex-test1.err | grep -v 'warning: Locale charset' | grep -v '^ '
75 test $result = 0 || { exit 1; }
76
77 cat <<\EOF > mex-test1.ok
78 ========================= mex-test1.po:4 =========================
79
80 ---
81 Project-Id-Version: Bonnie Tyler
82 Content-Type: text/plain; charset=ISO-8859-1
83 Content-Transfer-Encoding: 8bit
84
85 ========================= mex-test1.po:12 =========================
86 The world is full of married men
87 ---
88 So viele verheiratete Männer
89 ========================= mex-test1.po:16 =========================
90 with wives who never understand
91 ---
92 und ihre Frauen verstehen sie nicht
93 ========================= mex-test1.po:20 =========================
94 They're looking for someone to share
95 ---
96
97 ========================= mex-test1.po:25 =========================
98 the excitement of a love affair
99 ---
100
101 ========================= mex-test1.po:29 =========================
102 Just as soon as they find you
103 ---
104
105 ========================= mex-test1.po:33 =========================
106 They warn you and darn you
107 ---
108
109 ========================= mex-test1.po:36 =========================
110 You fly on the wings of romance
111 ---
112 Die Flügel der frischen Liebe
113 heben dich zum Himmel
114 ========================= mex-test1.po:41 =========================
115 In the eyes of the world
116 ---
117 Für die anderen
118 ========================= mex-test1.po:45 =========================
119 You're just another crazy girl
120 ---
121 bist du bloß ein verrücktes dummes Ding
122 ========================= mex-test1.po:48 =========================
123 Who loves a married man
124 ---
125 das einen verheirateten Mann liebt
126 EOF
127
128 : ${DIFF=diff}
129 ${DIFF} mex-test1.ok mex-test1.out
130 result=$?
131
132 exit $result