# HG changeset patch # User Martin Geisler # Date 1252857637 -7200 # Node ID 57d682d7d2da8af2cc7e22168075b7c246ff85e2 # Parent f0105f2c424c963139207f61a3964ef31a9a5b99 test-gendoc: test documentation generation diff -r f0105f2c424c -r 57d682d7d2da tests/hghave --- a/tests/hghave Sun Sep 13 17:08:31 2009 +0200 +++ b/tests/hghave Sun Sep 13 18:00:37 2009 +0200 @@ -123,6 +123,10 @@ def has_git(): return matchoutput('git --version 2>&1', r'^git version') +def has_rst2html(): + return matchoutput('rst2html --version', r'^rst2html \(Docutils') or \ + matchoutput('rst2html.py --version', r'^rst2html.py \(Docutils') + def has_svn(): return matchoutput('svn --version 2>&1', r'^svn, version') and \ matchoutput('svnadmin --version 2>&1', r'^svnadmin, version') @@ -195,6 +199,7 @@ "outer-repo": (has_outer_repo, "outer repo"), "p4": (has_p4, "Perforce server and client"), "pygments": (has_pygments, "Pygments source highlighting library"), + "rst2html": (has_rst2html, "Docutils rst2html tool"), "svn": (has_svn, "subversion client and admin tools"), "svn-bindings": (has_svn_bindings, "subversion python bindings"), "symlink": (has_symlink, "symbolic links"), diff -r f0105f2c424c -r 57d682d7d2da tests/test-gendoc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-gendoc Sun Sep 13 18:00:37 2009 +0200 @@ -0,0 +1,12 @@ +#!/bin/sh + +"$TESTDIR/hghave" rst2html || exit 80 +RST2HTML=$(which rst2html 2> /dev/null || which rst2html.py) + +echo "checking for syntax errors in gendoc.py" +python $TESTDIR/../doc/gendoc.py > gendoc.txt || exit + +# We run rst2html over the file without adding "--halt warning" to +# make it report all errors instead of stopping on the first one. +echo "checking for parse errors with rst2html" +$RST2HTML gendoc.txt /dev/null diff -r f0105f2c424c -r 57d682d7d2da tests/test-gendoc.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-gendoc.out Sun Sep 13 18:00:37 2009 +0200 @@ -0,0 +1,2 @@ +checking for syntax errors in gendoc.py +checking for parse errors with rst2html