xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/tests/msgen-1 (revision 75f6d617e282811cb173c2ccfbf5df0dd71f7045)
1#! /bin/sh
2
3# Test general operation.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles men-test1.po"
9cat <<EOF > men-test1.po
10# HEADER.
11#
12msgid ""
13msgstr ""
14"Content-Type: text/plain; charset=ASCII\n"
15"Content-Transfer-Encoding: 8bit\n"
16
17msgid "height must be positive"
18msgstr ""
19
20msgid "color cannot be transparent"
21msgstr "colour cannot be transparent"
22
23msgid "width must be positive"
24msgstr ""
25
26msgid "%d error"
27msgid_plural "%d errors"
28msgstr[0] ""
29msgstr[1] ""
30EOF
31
32tmpfiles="$tmpfiles men-test1.out"
33: ${MSGEN=msgen}
34${MSGEN} -o men-test1.out men-test1.po
35test $? = 0 || { rm -fr $tmpfiles; exit 1; }
36
37tmpfiles="$tmpfiles men-test1.ok"
38cat <<EOF > men-test1.ok
39# HEADER.
40#
41msgid ""
42msgstr ""
43"Content-Type: text/plain; charset=ASCII\n"
44"Content-Transfer-Encoding: 8bit\n"
45
46msgid "height must be positive"
47msgstr "height must be positive"
48
49msgid "color cannot be transparent"
50msgstr "colour cannot be transparent"
51
52msgid "width must be positive"
53msgstr "width must be positive"
54
55msgid "%d error"
56msgid_plural "%d errors"
57msgstr[0] "%d error"
58msgstr[1] "%d errors"
59EOF
60
61: ${DIFF=diff}
62${DIFF} men-test1.ok men-test1.out
63result=$?
64
65rm -fr $tmpfiles
66
67exit $result
68