No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / lang-rst
blob4acbe502ca0a4cb0de96fc5e9798da011844fc1c
1 #! /bin/sh
3 # Test of gettext facilities in the RST format.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles prog.rst"
9 cat <<\EOF > prog.rst
10 # From the rstconv program itself.
11 rstconv.help='rstconv [-h|--help] Displays this help'#10+
12 'rstconv options Convert rst file'#10#10+
13 'Options are:'#10+
14 ' -i file Use specified file instead of stdin as input .rst (OPTIONAL)'#10+
15 ' -o file Write output to specified file (REQUIRED)'#10+
16 ' -f format Specifies the output format:'#10+
17 ' po GNU gettext .po (portable) format (DEFAULT)'#10
19 rstconv.InvalidOption='Invalid option - '
20 rstconv.OptionAlreadySpecified='Option has already been specified - '
21 rstconv.NoOutFilename='No output filename specified'
22 rstconv.InvalidOutputFormat='Invalid output format -'
23 EOF
25 tmpfiles="$tmpfiles prog.pot"
26 : ${XGETTEXT=xgettext}
27 ${XGETTEXT} -o prog.pot --omit-header --add-location prog.rst
29 tmpfiles="$tmpfiles prog.ok"
30 cat <<EOF > prog.ok
31 #: rstconv.help
32 msgid ""
33 "rstconv [-h|--help] Displays this help\n"
34 "rstconv options Convert rst file\n"
35 "\n"
36 "Options are:\n"
37 " -i file Use specified file instead of stdin as input .rst (OPTIONAL)\n"
38 " -o file Write output to specified file (REQUIRED)\n"
39 " -f format Specifies the output format:\n"
40 " po GNU gettext .po (portable) format (DEFAULT)\n"
41 msgstr ""
43 #: rstconv.InvalidOption
44 msgid "Invalid option - "
45 msgstr ""
47 #: rstconv.OptionAlreadySpecified
48 msgid "Option has already been specified - "
49 msgstr ""
51 #: rstconv.NoOutFilename
52 msgid "No output filename specified"
53 msgstr ""
55 #: rstconv.InvalidOutputFormat
56 msgid "Invalid output format -"
57 msgstr ""
58 EOF
60 : ${DIFF=diff}
61 ${DIFF} prog.ok prog.pot || exit 1
63 # The output of rstconv is slightly different:
64 # - ModuleName:ConstName instead of ModuleName.ConstName
65 # - no line wrapping
66 # - extra newline at the end
68 tmpfiles="$tmpfiles prog.pot"
69 : ${RSTCONV=rstconv}
70 if (${RSTCONV} -o prog.pot -i prog.rst) >/dev/null 2>&1; then
72 tmpfiles="$tmpfiles prog.ok"
73 cat <<EOF > prog.ok
74 #: rstconv:help
75 msgid "rstconv [-h|--help] Displays this help\nrstconv options Convert rst file\n\nOptions are:\n -i file Use specified file instead of stdin as input .rst (OPTIONAL)\n -o file Write output to specified file (REQUIRED)\n -f format Specifies the output format:\n po GNU gettext .po (portable) format (DEFAULT)\n"
76 msgstr ""
78 #: rstconv:InvalidOption
79 msgid "Invalid option - "
80 msgstr ""
82 #: rstconv:OptionAlreadySpecified
83 msgid "Option has already been specified - "
84 msgstr ""
86 #: rstconv:NoOutFilename
87 msgid "No output filename specified"
88 msgstr ""
90 #: rstconv:InvalidOutputFormat
91 msgid "Invalid output format -"
92 msgstr ""
94 EOF
96 : ${DIFF=diff}
97 ${DIFF} prog.ok prog.pot || exit 1
101 rm -fr $tmpfiles
103 exit 0