source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Add a basic regression testing script.
@ 2010-05-16 17:40 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2010-05-16 17:40 UTC (permalink / raw)
  To: source

Log Message:
-----------
Add a basic regression testing script.

Added Files:
-----------
    mdocml/regress:
        regress.sh

Revision Data
-------------
--- /dev/null
+++ regress/regress.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+MANDOC=${MANDOC:-../mandoc}
+NROFF=${NROFF:-nroff}
+OUTPUT=${NROFF_OUTPUT:--Tascii}
+
+check_skip_list() {
+	[ -f skip_list ] || return 1
+	while read file; do
+		[ "$file" != "$1" ] || return 0
+	done < skip_list 
+	return 1
+}
+
+rm -rf output
+
+echo "Starting regression tests..."
+pass=0
+failed=0
+for file in */*.1 */*/*.1; do
+	[ -f "$file" ] || continue
+	check_skip_list "$file" && break
+	printf "%s: " "$file"
+	mandoc "$file" > test.mandoc 2> /dev/null
+	${NROFF} ${OUTPUT} -mandoc "$file" > test.nroff 2> /dev/null
+	if cmp -s test.mandoc test.nroff; then
+		echo "passed"
+		pass=`expr $pass + 1`
+	else
+		file2="output/$file"
+		mkdir -p `dirname $file2`
+		echo "failed, see $file2"
+		failed=`expr $failed + 1`
+		mv test.nroff "${file2}".nroff
+		mv test.mandoc "${file2}".mandoc
+		diff -u "${file2}".nroff "${file2}".mandoc > "${file2}".diff
+	fi
+done
+echo "Total: $pass passed, $failed failed"
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-16 17:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-16 17:40 mdocml: Add a basic regression testing script kristaps

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).