summaryrefslogtreecommitdiff
path: root/makeinfo/tests/cond
blob: 41f5920db7a48fdd9a387e9906be555d854785c1 (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
#!/bin/sh
# Test conditional text.

unset TEXINFO_OUTPUT
: ${srcdir=.}

# Default Info output.
../makeinfo -o cond.out $srcdir/cond.txi || exit 1
egrep 'This is (ifnothtml|ifinfo|ifnottex) text' cond.out >/dev/null \
  || exit 2
test `fgrep -c ' text.' cond.out` -eq 3 || exit 3

# Default HTML output.
../makeinfo --no-split --html -o cond.out $srcdir/cond.txi || exit 1
egrep 'This is (html|ifhtml|ifnotinfo|ifnottex) text' cond.out >/dev/null \
 || exit 2
test `fgrep -c ' text.' cond.out` -eq 4 || exit 3

# --ifhtml off, --ifinfo off, --iftex off.
../makeinfo --no-ifhtml --no-ifinfo --no-iftex -o cond.out $srcdir/cond.txi || exit 1
egrep 'This is ifnot(html|info|tex) text' cond.out >/dev/null \
 || exit 2
test `fgrep -c ' text.' cond.out` -eq 3 || exit 3

# Do we really need to test all the other permutations?

# --ifhtml on, --ifinfo on, --iftex on.
../makeinfo --ifhtml --ifinfo --iftex -o cond.out $srcdir/cond.txi || exit 1
egrep 'This is (html|ifhtml|ifinfo|tex|iftex) text' cond.out >/dev/null \
 || exit 2
test `fgrep -c ' text.' cond.out` -eq 5 || exit 3

rm -f cond.out cond.info