From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: pod2mdoc: start a regression suite
Date: Tue, 15 Jul 2014 15:20:49 -0400 (EDT) [thread overview]
Message-ID: <201407151920.s6FJKnll025823@krisdoz.my.domain> (raw)
Log Message:
-----------
start a regression suite
Added Files:
-----------
pod2mdoc/Regress:
Makefile.inc
p2m_postproc.pl
pod2mdoc/Regress/formatcode:
Makefile
invalid.pod
textline.pod
Revision Data
-------------
--- /dev/null
+++ Regress/Makefile.inc
@@ -0,0 +1,126 @@
+# --- utilities ---
+
+POD2MAN = pod2man -c 'OpenBSD Reference Manual' -d 'July 13, 2014' -r 'OpenBSD ports'
+GROFF = groff -Tascii -P -c
+MANDOC = mandoc -Tascii
+DIFF = diff -u
+POD2MDOC = /co/pod2mdoc/pod2mdoc -d 'July 13, 2014'
+
+# --- lists ---
+
+PREMANS = ${TARGETS:S/$/.preman/}
+MANS = ${TARGETS:S/$/.man/}
+GROFFMANS = ${TARGETS:S/$/.groff_man/}
+MANDOCMANS = ${TARGETS:S/$/.mandoc_man/}
+MANDOCMANMS = ${TARGETS:S/$/.mandoc_manm/}
+DIFFMANS = ${TARGETS:S/$/.diff_man/}
+MDOCS = ${TARGETS:S/$/.mdoc/}
+GROFFMDOCS = ${TARGETS:S/$/.groff_mdoc/}
+MANDOCMDOCS = ${TARGETS:S/$/.mandoc_mdoc/}
+DIFFMDOCS = ${TARGETS:S/$/.diff_mdoc/}
+DIFFS = ${TARGETS:S/$/.diff/}
+
+# --- production targets ---
+
+all: manall mdoc groffmdoc mandocmdoc diffmdoc maindiff
+
+clean: mdoc-clean groffmdoc-clean mandocmdoc-clean
+ rm -f *.part *.core
+
+mdoc: ${MDOCS}
+
+mdoc-clean:
+ rm -f ${MDOCS}
+
+groffmdoc: ${GROFFMDOCS}
+
+groffmdoc-clean:
+ rm -f ${GROFFMDOCS}
+
+mandocmdoc: ${MANDOCMDOCS}
+
+mandocmdoc-clean:
+ rm -f ${MANDOCMDOCS}
+
+diffmdoc: ${DIFFMDOCS}
+
+maindiff: ${DIFFS}
+
+# --- maintainer targets ---
+
+manall: man groffman mandocman mandocmanm diffman
+
+allclean: clean preman-clean man-clean \
+ groffman-clean mandocman-clean mandocmanm-clean
+
+preman: ${PREMANS}
+
+preman-clean:
+ rm -f ${PREMANS}
+
+man: ${MANS}
+
+man-clean:
+ rm -f ${MANS}
+
+groffman: ${GROFFMANS}
+
+groffman-clean:
+ rm -f ${GROFFMANS}
+
+mandocman: ${MANDOCMANS}
+
+mandocman-clean:
+ rm -f ${MANDOCMANS}
+
+mandocmanm: ${MANDOCMANMS}
+
+mandocmanm-clean:
+ rm -f ${MANDOCMANMS}
+
+diffman: ${DIFFMANS}
+
+.for t in ${TARGETS}
+${t}.diff_man: ${t}.groff_man ${t}.mandoc_man
+ ${DIFF} $?
+${t}.diff_mdoc: ${t}.groff_mdoc ${t}.mandoc_mdoc
+ ${DIFF} $?
+${t}.diff: ${t}.mandoc_manm ${t}.mandoc_mdoc
+ ${DIFF} $?
+.endfor
+
+# --- suffix rules ---
+
+.SUFFIXES: .pod .preman .man .groff_man .mandoc_man .mandoc_manm .diff_man
+.SUFFIXES: .mdoc .groff_mdoc .mandoc_mdoc
+
+.pod.preman:
+ -${POD2MAN} $< > $@
+
+.preman.man:
+ ../p2m_postproc.pl < $< > $@.part
+ @mv $@.part $@
+
+.man.groff_man:
+ ${GROFF} -man $< > $@.part
+ @mv $@.part $@
+
+.man.mandoc_man:
+ ${MANDOC} -man $< > $@.part
+ @mv $@.part $@
+
+.man.mandoc_manm:
+ ${MANDOC} -man -Omdoc $< > $@.part
+ @mv $@.part $@
+
+.pod.mdoc:
+ ${POD2MDOC} $< > $@.part
+ @mv $@.part $@
+
+.mdoc.groff_mdoc:
+ ${GROFF} -mdoc $< > $@.part
+ @mv $@.part $@
+
+.mdoc.mandoc_mdoc:
+ ${MANDOC} -mdoc -Ios='OpenBSD ports' $< > $@.part
+ @mv $@.part $@
--- /dev/null
+++ Regress/p2m_postproc.pl
@@ -0,0 +1,13 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+while (<>) {
+ print;
+ last if $_ eq ".SH \"NAME\"\n";
+}
+$_ = <> // die 'no name section';
+s/(.*?)( \\- .*)/\\fB$1\\fP$2/ or die 'bad name section';
+print;
+print <>;
+exit 0;
--- /dev/null
+++ Regress/formatcode/invalid.pod
@@ -0,0 +1,9 @@
+=head1 NAME
+
+invalid - invalid escape sequence
+
+=head1 DESCRIPTION
+
+beforeY<invalid>after
+
+before B<inY<val>id> after
--- /dev/null
+++ Regress/formatcode/textline.pod
@@ -0,0 +1,11 @@
+=head1 NAME
+
+textline - escape sequences on text lines
+
+=head1 DESCRIPTION
+
+beforeB<bold>
+
+before B<bold>
+
+first secondI<italic>
--- /dev/null
+++ Regress/formatcode/Makefile
@@ -0,0 +1,3 @@
+TARGETS = invalid textline
+
+.include "../Makefile.inc"
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
reply other threads:[~2014-07-15 19:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201407151920.s6FJKnll025823@krisdoz.my.domain \
--to=schwarze@mdocml.bsd.lv \
--cc=source@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).