diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2009-10-28 03:20:43 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2009-10-28 03:20:43 +0000 |
commit | 687986bfa8d0dea72bb94a1483d9b90e1dc619e4 (patch) | |
tree | 812881c3c232b1a0555a82e9d19b4667a1e0cb3d | |
parent | dc0eb5746196ad1c844e4cec86b96c7ed8f795d1 (diff) |
Add the first batch of mandoc(1) regression tests, testing for a few bugs
fixed in 1.9.9 and some older, rather subtle issues in list displays.
Directory layout and naming scheme was chosen such that later inclusion
of tests for -man and -Thtml will not force us to rename everything,
even though the layout might still seem a bit sparse right now.
More tests will slowly be added while investigating and fixing issues.
-rw-r--r-- | regress/usr.bin/mandoc/Makefile | 7 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/Makefile.inc | 37 | ||||
-rwxr-xr-x | regress/usr.bin/mandoc/mdoc/Bl/EMULTILIST.sh | 40 | ||||
-rwxr-xr-x | regress/usr.bin/mandoc/mdoc/Bl/ENOTYPE.sh | 33 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Bl/Makefile | 20 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Bl/diag.in | 39 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Bl/hang.in | 47 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Bl/inset.in | 39 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Bl/tag.in | 39 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/In/Makefile | 6 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/In/break.in | 13 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Makefile | 7 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Makefile.inc | 3 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Rs/Makefile | 6 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Rs/break.in | 20 |
15 files changed, 356 insertions, 0 deletions
diff --git a/regress/usr.bin/mandoc/Makefile b/regress/usr.bin/mandoc/Makefile new file mode 100644 index 00000000000..1519e0b23f9 --- /dev/null +++ b/regress/usr.bin/mandoc/Makefile @@ -0,0 +1,7 @@ +# $OpenBSD: Makefile,v 1.1 2009/10/28 03:20:42 schwarze Exp $ + +SUBDIR+= mdoc + +groff groff-clean: _SUBDIRUSE + +.include <bsd.subdir.mk> diff --git a/regress/usr.bin/mandoc/Makefile.inc b/regress/usr.bin/mandoc/Makefile.inc new file mode 100644 index 00000000000..452add82268 --- /dev/null +++ b/regress/usr.bin/mandoc/Makefile.inc @@ -0,0 +1,37 @@ +# $OpenBSD: Makefile.inc,v 1.1 2009/10/28 03:20:42 schwarze Exp $ + +DIFF=diff -au +MANDOC?=mandoc +MANDOCOPTS=-fstrict -Wall +NROFF=nroff -mandoc +SED=sed +SH=/bin/sh + +all: clean + +groff: ${GROFF_TARGETS:C/$/.out_ascii/} + +.SUFFIXES: .in .out_ascii .sh + +.in: + @echo " -> ${*}" + @${MANDOC} ${MANDOCOPTS} ${.CURDIR}/${*}.in | ${SED} '$$d' \ + > ${*}.mandoc_ascii + @${DIFF} ${*}.out_ascii ${*}.mandoc_ascii + +.in.out_ascii: + @echo " -> ${*}" + @${NROFF} ${.CURDIR}/${<} | ${SED} '$$d' > ${@} + +.sh: + @echo " -> ${*}" + @MANDOC="${MANDOC}" MANDOCOPTS="${MANDOCOPTS}" \ + ${SH} ${.CURDIR}/${*}.sh + +clean: + rm -f *.mandoc_ascii + +groff-clean: +.if defined(GROFF_TARGETS) + rm -f ${GROFF_TARGETS:C/$/.out_ascii/} +.endif diff --git a/regress/usr.bin/mandoc/mdoc/Bl/EMULTILIST.sh b/regress/usr.bin/mandoc/mdoc/Bl/EMULTILIST.sh new file mode 100755 index 00000000000..b174e412a05 --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/Bl/EMULTILIST.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +trap 'rm -f *.*_tmp' EXIT + +ltypes="bullet dash enum hyphen item tag diag hang ohang inset column" + +for first in $ltypes; do + for second in $ltypes; do + ${MANDOC} > EMULTILIST.out_tmp 2> EMULTILIST.err_tmp << __EOF__; +.Dd \$Mdocdate: October 28 2009 $ +.Dt EMULTILIST 1 +.Os +.Sh NAME +.Nm EMULTILIST +.Nd list of multiple types +.Sh DESCRIPTION +.Bl -${first} -${second} +.El +__EOF__ + if [ $? -eq 0 ]; then + echo ".Bl -$first -$second failed to fail" + exit 1 + fi + if [ -s EMULTILIST.out_tmp ]; then + echo ".Bl -$first -$second produced output" + cat EMULTILIST.out_tmp + exit 1 + fi + if ! grep -q 'too many list types' EMULTILIST.err_tmp; then + echo ".Bl -$first -$second did not throw EMULTILIST" + exit 1 + fi + if grep -qv 'too many list types' EMULTILIST.err_tmp; then + echo ".Bl -$first -$second returned unexpected error" + cat EMULTILIST.err_tmp + fi + done +done + +exit 0 diff --git a/regress/usr.bin/mandoc/mdoc/Bl/ENOTYPE.sh b/regress/usr.bin/mandoc/mdoc/Bl/ENOTYPE.sh new file mode 100755 index 00000000000..7d7aebde181 --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/Bl/ENOTYPE.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +trap 'rm -f *.*_tmp' EXIT + +ltypes="bullet dash enum hyphen item tag diag hang ohang inset column" +atypes="compact width offset" +for list in $ltypes; do + for arg in $atypes; do + [ "X$arg" = "Xcompact" ] && arg2="" || arg2="Ds" + ${MANDOC} ${MANDOCOPTS} > ENOTYPE.out_tmp 2> ENOTYPE.err_tmp << __EOF__; +.Dd \$Mdocdate: October 28 2009 $ +.Dt ENOTYPE 1 +.Os +.Sh NAME +.Nm ENOTYPE +.Nd list argument before list type +.Sh DESCRIPTION +.Bl -${arg} ${arg2} -${list} +.El +__EOF__ + if [ $? -ne 0 ]; then + echo ".Bl -$arg -$list failed" + cat ENOTYPE.err_tmp + exit 1 + fi + if ! grep -q 'list arguments preceding type' ENOTYPE.err_tmp; then + echo ".Bl -$arg -$list did not throw ENOTYPE" + exit 1 + fi + done +done + +exit 0 diff --git a/regress/usr.bin/mandoc/mdoc/Bl/Makefile b/regress/usr.bin/mandoc/mdoc/Bl/Makefile new file mode 100644 index 00000000000..9e8722722a0 --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/Bl/Makefile @@ -0,0 +1,20 @@ +# $OpenBSD: Makefile,v 1.1 2009/10/28 03:20:42 schwarze Exp $ + +REGRESS_TARGETS=tag inset hang diag +GROFF_TARGETS=tag inset hang diag + +REGRESS_TARGETS+=EMULTILIST ENOTYPE +REGRESS_SLOW_TARGETS=EMULTILIST + +# broken: +# different rendering of bullet +# and different indentation +#REGRESS_TARGETS+=bullet +#GROFF_TARGETS+=bullet.out_ascii + +# broken: +# different indentation +#REGRESS_TARGETS+=enum +#GROFF_TARGETS+=enum.out_ascii + +.include <bsd.regress.mk> diff --git a/regress/usr.bin/mandoc/mdoc/Bl/diag.in b/regress/usr.bin/mandoc/mdoc/Bl/diag.in new file mode 100644 index 00000000000..a35dbe11d40 --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/Bl/diag.in @@ -0,0 +1,39 @@ +.Dd $Mdocdate: October 28 2009 $ +.Dt BL-DIAG 1 +.Os +.Sh NAME +.Nm Bl-diag +.Nd section 4 diagnostic lists +.Sh DESCRIPTION +.Bl -diag +.It tag +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -diag +.It four +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -diag +.It quint +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -diag +.It indent +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -diag +.It septime +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -diag +.It achtacht +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -diag +.It neun_neun +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -diag +.It zehn__zehn +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El diff --git a/regress/usr.bin/mandoc/mdoc/Bl/hang.in b/regress/usr.bin/mandoc/mdoc/Bl/hang.in new file mode 100644 index 00000000000..238c911adc7 --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/Bl/hang.in @@ -0,0 +1,47 @@ +.Dd $Mdocdate: October 28 2009 $ +.Dt BL-HANG 1 +.Os +.Sh NAME +.Nm Bl-hang +.Nd hanged lists +.Sh DESCRIPTION +.Bl -hang -width 5n +.It tag +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -hang -width 5n +.It four +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -hang -width 5n +.It quint +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -hang -width 5n +.It indent +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -hang -width 5n +.It septime +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -hang -width 5n +.It achtacht +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -hang -width 5n +.It neun_neun +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -hang -width 5n +.It zehn__zehn +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El diff --git a/regress/usr.bin/mandoc/mdoc/Bl/inset.in b/regress/usr.bin/mandoc/mdoc/Bl/inset.in new file mode 100644 index 00000000000..19e83cf5c81 --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/Bl/inset.in @@ -0,0 +1,39 @@ +.Dd $Mdocdate: October 28 2009 $ +.Dt BL-INSET 1 +.Os +.Sh NAME +.Nm Bl-inset +.Nd inset list labels +.Sh DESCRIPTION +.Bl -inset +.It tag +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -inset +.It four +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -inset +.It quint +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -inset +.It indent +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -inset +.It septime +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -inset +.It achtacht +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -inset +.It neun_neun +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -inset +.It zehn__zehn +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El diff --git a/regress/usr.bin/mandoc/mdoc/Bl/tag.in b/regress/usr.bin/mandoc/mdoc/Bl/tag.in new file mode 100644 index 00000000000..a926e0da2c3 --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/Bl/tag.in @@ -0,0 +1,39 @@ +.Dd $Mdocdate: October 28 2009 $ +.Dt BL-TAG 1 +.Os +.Sh NAME +.Nm Bl-tag +.Nd tagged lists +.Sh DESCRIPTION +.Bl -tag -width 5n +.It tag +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -tag -width 5n +.It four +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -tag -width 5n +.It quint +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -tag -width 5n +.It indent +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -tag -width 5n +.It septime +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -tag -width 5n +.It achtacht +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -tag -width 5n +.It neun neun +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El +.Bl -tag -width 5n +.It zehn_ zehn +x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x +.El diff --git a/regress/usr.bin/mandoc/mdoc/In/Makefile b/regress/usr.bin/mandoc/mdoc/In/Makefile new file mode 100644 index 00000000000..0fe06d4ac63 --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/In/Makefile @@ -0,0 +1,6 @@ +# $OpenBSD: Makefile,v 1.1 2009/10/28 03:20:42 schwarze Exp $ + +REGRESS_TARGETS=break +GROFF_TARGETS=break + +.include <bsd.regress.mk> diff --git a/regress/usr.bin/mandoc/mdoc/In/break.in b/regress/usr.bin/mandoc/mdoc/In/break.in new file mode 100644 index 00000000000..bbdc52d4591 --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/In/break.in @@ -0,0 +1,13 @@ +.Dd $Mdocdate: October 28 2009 $ +.Dt IN-BREAK 2 +.Os +.Sh NAME +.Nm In-break +.Nd line break before header include file +.Sh SYNOPSIS +.In fcntl.h +.Ft int +.Fn open "const char *path" "int flags" "mode_t mode" +.In unistd.h +.Ft ssize_t +.Fn write "int d" "const void *buf" "size_t nbytes" diff --git a/regress/usr.bin/mandoc/mdoc/Makefile b/regress/usr.bin/mandoc/mdoc/Makefile new file mode 100644 index 00000000000..f31165f0a87 --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/Makefile @@ -0,0 +1,7 @@ +# $OpenBSD: Makefile,v 1.1 2009/10/28 03:20:42 schwarze Exp $ + +SUBDIR+= Bl In Rs + +groff groff-clean: _SUBDIRUSE + +.include <bsd.subdir.mk> diff --git a/regress/usr.bin/mandoc/mdoc/Makefile.inc b/regress/usr.bin/mandoc/mdoc/Makefile.inc new file mode 100644 index 00000000000..3c6f23849ea --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/Makefile.inc @@ -0,0 +1,3 @@ +# $OpenBSD: Makefile.inc,v 1.1 2009/10/28 03:20:42 schwarze Exp $ + +.include "../Makefile.inc" diff --git a/regress/usr.bin/mandoc/mdoc/Rs/Makefile b/regress/usr.bin/mandoc/mdoc/Rs/Makefile new file mode 100644 index 00000000000..0fe06d4ac63 --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/Rs/Makefile @@ -0,0 +1,6 @@ +# $OpenBSD: Makefile,v 1.1 2009/10/28 03:20:42 schwarze Exp $ + +REGRESS_TARGETS=break +GROFF_TARGETS=break + +.include <bsd.regress.mk> diff --git a/regress/usr.bin/mandoc/mdoc/Rs/break.in b/regress/usr.bin/mandoc/mdoc/Rs/break.in new file mode 100644 index 00000000000..cee12deb335 --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/Rs/break.in @@ -0,0 +1,20 @@ +.Dd $Mdocdate: October 28 2009 $ +.Dt RS-BREAK 1 +.Os +.Sh NAME +.Nm Rs-break +.Nd line break before reference start +.Sh DESCRIPTION +reference on the same line: +.Rs +.%A author +.%J journal +.%N 42 +.Re +.Sh SEE ALSO +reference after a blank line: +.Rs +.%A author +.%J journal +.%N 42 +.Re |