diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index b1e44d385..52bbf7192 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -257,7 +257,7 @@ PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d %(rbuilddir)s/doctrees $(PAPEROPT_$(PAPER)) \ $(SPHINXOPTS) %(rsrcdir)s -.PHONY: help clean html pickle json htmlhelp qthelp latex changes linkcheck +.PHONY: help clean html pickle json htmlhelp qthelp latex changes linkcheck doctest help: \t@echo "Please use \\`make ' where is one of" @@ -269,6 +269,7 @@ help: \t@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" \t@echo " changes to make an overview over all changed/added/deprecated items" \t@echo " linkcheck to check all external links for integrity" +\t@echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: \t-rm -rf %(rbuilddir)s/* @@ -320,6 +321,11 @@ linkcheck: \t@echo \t@echo "Link check complete; look for any errors in the above output " \\ \t "or in %(rbuilddir)s/linkcheck/output.txt." + +doctest: +\t$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) %(rbuilddir)s/doctest +\t@echo "Testing of doctests in the sources finished, look at the " \\ +\t "results in %(rbuilddir)s/doctest/output.txt." ''' BATCHFILE = '''\ @@ -346,6 +352,7 @@ if "%%1" == "help" ( \techo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter \techo. changes to make an overview over all changed/added/deprecated items \techo. linkcheck to check all external links for integrity +\techo. doctest to run all doctests embedded in the documentation (if enabled) \tgoto end ) @@ -417,6 +424,14 @@ or in %(rbuilddir)s/linkcheck/output.txt. \tgoto end ) +if "%%1" == "doctest" ( +\t%%SPHINXBUILD%% -b doctest %%ALLSPHINXOPTS%% %(rbuilddir)s/doctest +\techo. +\techo.Testing of doctests in the sources finished, look at the ^ +results in %(rbuilddir)s/doctest/output.txt. +\tgoto end +) + :end '''