Imported Upstream version 1.23.0
[platform/upstream/groff.git] / src / utils / grog / tests / smoke-test.sh
1 #!/bin/sh
2 #
3 # Copyright (C) 2021 Free Software Foundation, Inc.
4 #
5 # This file is part of groff.
6 #
7 # groff is free software; you can redistribute it and/or modify it under
8 # the terms of the GNU General Public License as published by the Free
9 # Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # groff is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 # for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #
20
21 set -e
22
23 grog="${abs_top_builddir:-.}/grog"
24 src="${abs_top_srcdir:-..}"
25
26 doc=src/preproc/eqn/neqn.1
27 echo "testing simple man(7) page $doc" >&2
28 "$grog" "$doc" | \
29             grep -Fqx 'groff -man '"$doc"
30
31 doc=src/preproc/tbl/tbl.1
32 echo "testing tbl(1)-using man(7) page $doc" >&2
33 "$grog" "$doc" | \
34     grep -Fqx 'groff -t -man '"$doc"
35
36 doc=man/groff_diff.7
37 echo "testing eqn(1)-using man(7) page $doc" >&2
38 "$grog" "$doc" | \
39     grep -Fqx 'groff -e -man '"$doc"
40
41 # BUG: grog doesn't yet handle .if, .ie, .while.
42 #doc=src/preproc/soelim/soelim.1
43 #echo "testing pic(1)-using man(7) page $doc" >&2
44 #"$grog" "$doc" | \
45 #    grep -Fqx 'groff -p -man '"$doc"
46
47 doc=tmac/groff_mdoc.7
48 echo "testing tbl(1)-using mdoc(7) page $doc" >&2
49 "$grog" "$doc" | \
50     grep -Fqx 'groff -t -mdoc '"$doc"
51
52 doc=$src/doc/meintro.me.in
53 echo "testing me(7) document $doc" >&2
54 "$grog" "$doc" | \
55     grep -Fqx 'groff -me '"$doc"
56
57 doc=$src/doc/meintro_fr.me.in
58 echo "testing tbl(1)-using me(7) document $doc" >&2
59 "$grog" "$doc" | \
60     grep -Fqx 'groff -t -me '"$doc"
61
62 doc=$src/doc/meref.me.in
63 echo "testing me(7) document $doc" >&2
64 "$grog" "$doc" | \
65     grep -Fqx 'groff -me '"$doc"
66
67 doc=$src/doc/grnexmpl.me
68 echo "testing grn(1)- and eqn(1)-using me(7) document $doc" >&2
69 "$grog" "$doc" | \
70     grep -Fqx 'groff -e -g -me '"$doc"
71
72 doc=$src/contrib/mm/examples/letter.mm
73 echo "testing mm(7) document $doc" >&2
74 "$grog" "$doc" | \
75     grep -Fqx 'groff -mm '"$doc"
76
77 doc=$src/contrib/mom/examples/copyright-chapter.mom
78 echo "testing mom(7) document $doc" >&2
79 "$grog" "$doc" | \
80     grep -Fqx 'groff -mom '"$doc"
81
82 doc=$src/contrib/mom/examples/copyright-default.mom
83 echo "testing mom(7) document $doc" >&2
84 "$grog" "$doc" | \
85     grep -Fqx 'groff -mom '"$doc"
86
87 doc=$src/contrib/mom/examples/letter.mom
88 echo "testing mom(7) document $doc" >&2
89 "$grog" "$doc" | \
90     grep -Fqx 'groff -mom '"$doc"
91
92 doc=$src/contrib/mom/examples/mom-pdf.mom
93 echo "testing mom(7) document $doc" >&2
94 "$grog" "$doc" | \
95     grep -Fqx 'groff -mom '"$doc"
96
97 doc=$src/contrib/mom/examples/mon_premier_doc.mom
98 echo "testing mom(7) document $doc" >&2
99 "$grog" "$doc" | \
100     grep -Fqx 'groff -mom '"$doc"
101
102 doc=$src/contrib/mom/examples/sample_docs.mom
103 echo "testing mom(7) document $doc" >&2
104 "$grog" "$doc" | \
105     grep -Fqx 'groff -mom '"$doc"
106
107 doc=$src/contrib/mom/examples/slide-demo.mom
108 echo "testing mom(7) document $doc" >&2
109 "$grog" "$doc" | \
110     grep -Fqx 'groff -e -p -t -mom '"$doc"
111
112 doc=$src/contrib/mom/examples/typesetting.mom
113 echo "testing mom(7) document $doc" >&2
114 "$grog" "$doc" | \
115     grep -Fqx 'groff -mom '"$doc"
116
117 doc=$src/contrib/pdfmark/cover.ms
118 echo "testing ms(7) document $doc" >&2
119 "$grog" "$doc" | \
120     grep -Fqx 'groff -ms '"$doc"
121
122 doc=$src/contrib/pdfmark/pdfmark.ms
123 echo "testing ms(7) document $doc" >&2
124 "$grog" "$doc" | \
125     grep -Fqx 'groff -ms '"$doc"
126
127 doc=$src/doc/ms.ms
128 echo "testing eqn(1)- and tbl(1)-using ms(7) document $doc" >&2
129 "$grog" "$doc" | \
130     grep -Fqx 'groff -e -t -ms '"$doc"
131
132 doc=$src/doc/pic.ms
133 echo "testing tbl(1)-, eqn(1)-, and pic(1)-using ms(7) document $doc" \
134     >&2
135 "$grog" "$doc" | \
136     grep -Fqx 'groff -e -p -t -ms '"$doc"
137
138 doc=$src/doc/webpage.ms
139 echo "testing ms(7) document $doc" >&2
140 # BUG: Should detect -mwww (and -mpspic?) too.
141 "$grog" "$doc" | \
142     grep -Fqx 'groff -ms '"$doc"
143
144 # Test manual specification of auxiliary macro packages.
145 echo "testing ms(7) document $doc with '-m www' option" >&2
146 "$grog" "$doc" -m www | \
147     grep -Fqx 'groff -ms -mwww '"$doc"
148
149 echo "testing ms(7) document $doc with '-mwww' option" >&2
150 "$grog" "$doc" -mwww | \
151     grep -Fqx 'groff -ms -mwww '"$doc"
152
153 # vim:set ai et sw=4 ts=4 tw=72: