X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/647acb5f407c785d291517c76649421d800b9bc5..6def9e6849d2a7530ac499cd2b141353134283ac:/regress/regress.sh?ds=inline diff --git a/regress/regress.sh b/regress/regress.sh index baa7e819..1e17f3a8 100755 --- a/regress/regress.sh +++ b/regress/regress.sh @@ -4,6 +4,12 @@ MANDOC=${MANDOC:-../mandoc} NROFF=${NROFF:-nroff} OUTPUT=${NROFF_OUTPUT:--Tascii} +if [ ! -x $MANDOC ] +then + echo "regress.sh: command not found: $MANDOC" 1>&2 + return 0 +fi + check_skip_list() { [ -f skip_list ] || return 1 while read file; do @@ -17,13 +23,18 @@ rm -rf output echo "Starting regression tests..." pass=0 failed=0 -for file in */*.1 */*/*.1; do +for file in */*.in */*/*.in; do [ -f "$file" ] || continue check_skip_list "$file" && break printf "%s: " "$file" - mandoc "$file" > test.mandoc 2> /dev/null + ${MANDOC} "$file" > test.mandoc 2> /dev/null ${NROFF} ${OUTPUT} -mandoc "$file" > test.nroff 2> /dev/null - if cmp -s test.mandoc test.nroff; then + l=`wc -l < test.mandoc` + head -n `expr $l - 1` test.mandoc | tail -n `expr $l - 2` > test.mandoc_ + l=`wc -l < test.nroff` + head -n `expr $l - 1` test.nroff| tail -n `expr $l - 2` > test.nroff_ + if cmp -s test.mandoc_ test.nroff_; then + rm -f test.mandoc test.nroff echo "passed" pass=`expr $pass + 1` else @@ -36,4 +47,5 @@ for file in */*.1 */*/*.1; do diff -u "${file2}".nroff "${file2}".mandoc > "${file2}".diff fi done +rm -f test.mandoc_ test.nroff_ echo "Total: $pass passed, $failed failed"