summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2017-03-05 19:57:36 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2017-03-05 19:57:36 +0000
commita4d2ef5a35cedc09ddebd36bbbe54ed324841aa9 (patch)
treebe4af8878cb718e732bca31c6214838dfbe89073
parent4b0f970e4c15e4f4719ea3d017f80ada2fa9dfbd (diff)
Infrastructure for -T markdown tests.
This is needed because -T marksdown is expected to receive less maintenance than -T ascii, so we need automation to make sure that regular parser maintenance doesn't break this output mode.
-rw-r--r--regress/usr.bin/mandoc/Makefile.inc49
-rw-r--r--regress/usr.bin/mandoc/Makefile.sub12
2 files changed, 51 insertions, 10 deletions
diff --git a/regress/usr.bin/mandoc/Makefile.inc b/regress/usr.bin/mandoc/Makefile.inc
index bc25a5befcc..97f6c126c2f 100644
--- a/regress/usr.bin/mandoc/Makefile.inc
+++ b/regress/usr.bin/mandoc/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.20 2015/02/03 19:37:25 schwarze Exp $
+# $OpenBSD: Makefile.inc,v 1.21 2017/03/05 19:57:35 schwarze Exp $
.include "Makefile.sub"
@@ -33,6 +33,9 @@ _UTF8DIFFS = ${UTF8_TARGETS:C/$/.diff_utf8/}
_HTMLFILES = ${HTML_TARGETS:C/$/.mandoc_html/}
_HTMLDIFFS = ${HTML_TARGETS:C/$/.diff_html/}
+_MARKDOWNFILES = ${MARKDOWN_TARGETS:C/$/.mandoc_markdown/}
+_MARKDOWNDIFFS = ${MARKDOWN_TARGETS:C/$/.diff_markdown/}
+
_LINTFILES =
_LINTDIFFS =
.for t in ${LINT_TARGETS}
@@ -53,6 +56,8 @@ utf8: utf8-clean ${_UTF8DIFFS}
html: html-clean ${_HTMLDIFFS}
+markdown: markdown-clean ${_MARKDOWNDIFFS}
+
tman: tman-clean ${_MANDIFFS}
lint: lint-clean ${_LINTDIFFS}
@@ -61,10 +66,11 @@ htmlval: ${_HTMLVALS}
# --- suffix rules ---
-.SUFFIXES: .diff_ascii .diff_html .diff_lint .diff_man .diff_utf8 \
+.SUFFIXES: .diff_ascii .diff_html .diff_lint \
+ .diff_man .diff_markdown .diff_utf8 \
.in .in_man \
.mandoc_ascii .mandoc_html .mandoc_lint \
- .mandoc_man .mandoc_utf8 \
+ .mandoc_man .mandoc_markdown .mandoc_utf8 \
.out_ascii .out_lint .out_utf8
.in.mandoc_ascii:
@@ -86,6 +92,13 @@ htmlval: ${_HTMLVALS}
.mandoc_html.diff_html:
@${DIFF} ${.CURDIR}/${.IMPSRC:S/mandoc_html$/out_html/} ${.IMPSRC}
+.in.mandoc_markdown:
+ @${MANDOC} ${MOPTS} -Tmarkdown ${.IMPSRC} > ${.TARGET}
+
+.mandoc_markdown.diff_markdown:
+ @${DIFF} ${.CURDIR}/${.IMPSRC:S/mandoc_markdown$/out_markdown/} \
+ ${.IMPSRC}
+
.in.in_man:
@${MANDOC} ${MOPTS} -Tman ${.IMPSRC} > ${.TARGET}
@@ -125,6 +138,10 @@ ${t}: ${t}.diff_utf8
${t}: ${t}.diff_html
.endfor
+.for t in ${MARKDOWN_TARGETS}
+${t}: ${t}.diff_markdown
+.endfor
+
.for t in ${LINT_TARGETS}
${t}: ${t}.diff_lint
.endfor
@@ -148,6 +165,11 @@ html-clean:
@rm -f ${_HTMLFILES}
.endif
+markdown-clean:
+.if !empty(_MARKDOWNFILES)
+ @rm -f ${_MARKDOWNFILES}
+.endif
+
tman-clean:
.if !empty(_MANFILES)
@rm -f ${_MANFILES}
@@ -158,8 +180,8 @@ lint-clean:
@rm -f ${_LINTFILES}
.endif
-.PHONY: ${_ASCIIDIFFS} ${_UTF8DIFFS} ${_HTMLDIFFS} ${_MANDIFFS} \
- ${_LINTDIFFS} ${_HTMLVALS}
+.PHONY: ${_ASCIIDIFFS} ${_UTF8DIFFS} ${_HTMLDIFFS} ${_MARKDOWNDIFFS} \
+ ${_MANDIFFS} ${_LINTDIFFS} ${_HTMLVALS}
# ----------------------------------------------------------------------
@@ -183,6 +205,7 @@ SKIP_GROFF_UTF8 += ${SKIP_GROFF}
_OUTFILES =
_HTMLOUTFILES =
+_MARKDOWNOUTFILES =
_LINTOUTFILES =
.for t in ${REGRESS_TARGETS}
. if empty(SKIP_GROFF_ASCII:M${t}) && \
@@ -201,6 +224,10 @@ _OUTFILES += ${t}.out_utf8
_HTMLOUTFILES += ${t}.out_html
.endfor
+.for t in ${MARKDOWN_TARGETS}
+_MARKDOWNOUTFILES += ${t}.out_markdown
+.endfor
+
.for t in ${LINT_TARGETS}
_LINTOUTFILES += ${t}.out_lint
.endfor
@@ -211,6 +238,8 @@ groff: obj-check ${_OUTFILES}
html-out: obj-check ${_HTMLOUTFILES}
+markdown-out: obj-check ${_MARKDOWNOUTFILES}
+
lint-out: obj-check ${_LINTOUTFILES}
# --- single-file targets ---
@@ -245,6 +274,11 @@ ${t}.out_html: ${t}.in
sed -n '/^BEGINTEST/,/^ENDTEST/p' > ${.TARGET}
.endfor
+.for t in ${MARKDOWN_TARGETS}
+${t}.out_markdown: ${t}.in
+ ${MANDOC} ${MOPTS} -Tmarkdown ${.ALLSRC} > ${.TARGET}
+.endfor
+
.for t in ${LINT_TARGETS}
${t}.out_lint: ${t}.in
-${MANDOC} ${MOPTS} -Tlint ${.ALLSRC} > ${.TARGET} 2>&1
@@ -262,6 +296,11 @@ html-out-clean: obj-check
rm -f ${_HTMLOUTFILES}
.endif
+markdown-out-clean: obj-check
+.if !empty(_MARKDOWNOUTFILES)
+ rm -f ${_MARKDOWNOUTFILES}
+.endif
+
lint-out-clean: obj-check
.if !empty(_LINTOUTFILES)
rm -f ${_LINTOUTFILES}
diff --git a/regress/usr.bin/mandoc/Makefile.sub b/regress/usr.bin/mandoc/Makefile.sub
index 0e21bbb81ea..611d41ca6de 100644
--- a/regress/usr.bin/mandoc/Makefile.sub
+++ b/regress/usr.bin/mandoc/Makefile.sub
@@ -1,9 +1,11 @@
-# $OpenBSD: Makefile.sub,v 1.3 2014/10/27 15:05:45 schwarze Exp $
+# $OpenBSD: Makefile.sub,v 1.4 2017/03/05 19:57:35 schwarze Exp $
-_MAIN_TARGETS = ascii utf8 html tman lint htmlval
-_CLEAN_TARGETS = ascii-clean utf8-clean html-clean tman-clean lint-clean
-_OUT_TARGETS = groff groff-clean html-out html-out-clean \
- lint-out lint-out-clean obj-clean
+_MAIN_TARGETS = ascii utf8 tman lint html markdown htmlval
+_CLEAN_TARGETS = ascii-clean utf8-clean tman-clean lint-clean \
+ html-clean markdown-clean
+_OUT_TARGETS = groff groff-clean lint-out lint-out-clean \
+ html-out html-out-clean markdown-out markdown-out-clean \
+ obj-clean
${_MAIN_TARGETS} ${_CLEAN_TARGETS} ${_OUT_TARGETS}: _SUBDIRUSE