cond 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. # $Id: cond,v 1.4 2010-12-04 00:05:53 karl Exp $
  3. # Public domain. Test conditional text.
  4. unset TEXINFO_OUTPUT LANG LANGUAGE
  5. LC_ALL=POSIX; export LC_ALL
  6. : ${srcdir=.}
  7. # Default Info output.
  8. ../makeinfo -o cond.out $srcdir/cond.txi || exit 1
  9. egrep 'This is (ifnothtml|ifinfo|ifnottex) text' cond.out >/dev/null \
  10. || exit 2
  11. test `fgrep -c ' text.' cond.out` -eq 3 || exit 3
  12. # Default HTML output.
  13. ../makeinfo --no-split --html -o cond.out $srcdir/cond.txi || exit 1
  14. egrep 'This is (html|ifhtml|ifnotinfo|ifnottex) text' cond.out >/dev/null \
  15. || exit 2
  16. test `fgrep -c ' text.' cond.out` -eq 4 || exit 3
  17. # --ifhtml off, --ifinfo off, --iftex off.
  18. ../makeinfo --no-ifhtml --no-ifinfo --no-iftex -o cond.out $srcdir/cond.txi || exit 1
  19. egrep 'This is ifnot(html|info|tex) text' cond.out >/dev/null \
  20. || exit 2
  21. test `fgrep -c ' text.' cond.out` -eq 3 || exit 3
  22. # Do we really need to test all the other permutations?
  23. # --ifhtml on, --ifinfo on, --iftex on.
  24. ../makeinfo --ifhtml --ifinfo --iftex -o cond.out $srcdir/cond.txi || exit 1
  25. egrep 'This is (html|ifhtml|ifinfo|tex|iftex) text' cond.out >/dev/null \
  26. || exit 2
  27. test `fgrep -c ' text.' cond.out` -eq 5 || exit 3
  28. rm -f cond.out cond.info