summaryrefslogtreecommitdiffstats
path: root/src/utils/grog/tests/smoke-test.sh
blob: 2da1fc4bcc95feeb3c36243f8c51010c850584ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/bin/sh
#
# Copyright (C) 2021 Free Software Foundation, Inc.
#
# This file is part of groff.
#
# groff is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# groff is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

set -e

grog="${abs_top_builddir:-.}/grog"
src="${abs_top_srcdir:-..}"

doc=src/preproc/eqn/neqn.1
echo "testing simple man(7) page $doc" >&2
"$grog" "$doc" | \
	    grep -Fqx 'groff -man '"$doc"

doc=src/preproc/tbl/tbl.1
echo "testing tbl(1)-using man(7) page $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -t -man '"$doc"

doc=man/groff_diff.7
echo "testing eqn(1)-using man(7) page $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -e -man '"$doc"

# BUG: grog doesn't yet handle .if, .ie, .while.
#doc=src/preproc/soelim/soelim.1
#echo "testing pic(1)-using man(7) page $doc" >&2
#"$grog" "$doc" | \
#    grep -Fqx 'groff -p -man '"$doc"

doc=tmac/groff_mdoc.7
echo "testing tbl(1)-using mdoc(7) page $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -t -mdoc '"$doc"

doc=$src/doc/meintro.me.in
echo "testing me(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -me '"$doc"

doc=$src/doc/meintro_fr.me.in
echo "testing tbl(1)-using me(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -t -me '"$doc"

doc=$src/doc/meref.me.in
echo "testing me(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -me '"$doc"

doc=$src/doc/grnexmpl.me
echo "testing grn(1)- and eqn(1)-using me(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -e -g -me '"$doc"

doc=$src/contrib/mm/examples/letter.mm
echo "testing mm(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -mm '"$doc"

doc=$src/contrib/mom/examples/copyright-chapter.mom
echo "testing mom(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -mom '"$doc"

doc=$src/contrib/mom/examples/copyright-default.mom
echo "testing mom(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -mom '"$doc"

doc=$src/contrib/mom/examples/letter.mom
echo "testing mom(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -mom '"$doc"

doc=$src/contrib/mom/examples/mom-pdf.mom
echo "testing mom(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -mom '"$doc"

doc=$src/contrib/mom/examples/mon_premier_doc.mom
echo "testing mom(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -mom '"$doc"

doc=$src/contrib/mom/examples/sample_docs.mom
echo "testing mom(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -mom '"$doc"

doc=$src/contrib/mom/examples/slide-demo.mom
echo "testing mom(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -e -p -t -mom '"$doc"

doc=$src/contrib/mom/examples/typesetting.mom
echo "testing mom(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -mom '"$doc"

doc=$src/contrib/pdfmark/cover.ms
echo "testing ms(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -ms '"$doc"

doc=$src/contrib/pdfmark/pdfmark.ms
echo "testing ms(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -ms '"$doc"

doc=$src/doc/ms.ms
echo "testing eqn(1)- and tbl(1)-using ms(7) document $doc" >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -e -t -ms '"$doc"

doc=$src/doc/pic.ms
echo "testing tbl(1)-, eqn(1)-, and pic(1)-using ms(7) document $doc" \
    >&2
"$grog" "$doc" | \
    grep -Fqx 'groff -e -p -t -ms '"$doc"

doc=$src/doc/webpage.ms
echo "testing ms(7) document $doc" >&2
# BUG: Should detect -mwww (and -mpspic?) too.
"$grog" "$doc" | \
    grep -Fqx 'groff -ms '"$doc"

# Test manual specification of auxiliary macro packages.
echo "testing ms(7) document $doc with '-m www' option" >&2
"$grog" "$doc" -m www | \
    grep -Fqx 'groff -ms -mwww '"$doc"

echo "testing ms(7) document $doc with '-mwww' option" >&2
"$grog" "$doc" -mwww | \
    grep -Fqx 'groff -ms -mwww '"$doc"

# vim:set ai et sw=4 ts=4 tw=72: