diff options
author | Robert Collins <robertc@robertcollins.net> | 2012-12-19 11:35:50 +1300 |
---|---|---|
committer | Robert Collins <robertc@robertcollins.net> | 2012-12-19 11:35:50 +1300 |
commit | 8b20441776e21a089d4d6dade3a8d5f08b108d39 (patch) | |
tree | 6fedc93ec8c51554fd78ab02c1463df4c24ef278 /doc | |
parent | e21582111e2a4b489b6d7e97109e0d3c5b75bc80 (diff) | |
parent | 3bf3afd5b96d8e00f03a49b1e4e0f0b3bf553353 (diff) | |
download | testrepository-git-8b20441776e21a089d4d6dade3a8d5f08b108d39.tar.gz |
Merge trunk.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/MANUAL.txt | 163 | ||||
-rw-r--r-- | doc/Makefile | 153 | ||||
-rw-r--r-- | doc/conf.py | 242 | ||||
-rw-r--r-- | doc/index.txt | 25 | ||||
-rw-r--r-- | doc/make.bat | 190 |
5 files changed, 755 insertions, 18 deletions
diff --git a/doc/MANUAL.txt b/doc/MANUAL.txt index 51f5caf..11f396b 100644 --- a/doc/MANUAL.txt +++ b/doc/MANUAL.txt @@ -8,9 +8,12 @@ Test repository is a small application for tracking test results. Any test run that can be represented as a subunit stream can be inserted into a repository. Typical workflow is to have a repository into which test runs are inserted, and -then to query the repository to find out about issues that need addressing. For -instance, using the sample subunit stream included with Test repository:: +then to query the repository to find out about issues that need addressing. +testr can fully automate this, but lets start with the low level facilities, +using the sample subunit stream included with testr:: + # Note that there is a .testr.conf already: + ls .testr.conf # Create a store to manage test results in. $ testr init # add a test result (shows failures) @@ -23,33 +26,58 @@ instance, using the sample subunit stream included with Test repository:: $ testr failing Most commands in testr have comprehensive online help, and the commands:: - $ testr help + + $ testr help [command] $ testr commands Will be useful to explore the system. +Configuration +~~~~~~~~~~~~~ + +testr is configured via the '.testr.conf' file which needs to be in the same +directory that testr is run from. testr includes online help for all the +options that can be set within it:: + + $ testr help run + +Python +------ + +If your test suite is written in Python, the simplest - and usually correct +configuration is:: + + [DEFAULT] + test_command=python -m subunit.run discover . $LISTOPT $IDOPTION + test_id_option=--load-list $IDFILE + test_list_option=--list + Running tests ~~~~~~~~~~~~~ -Test Repository can be taught how to run your tests by setting up a .testr.conf -file in your cwd. A file like:: +testr is taught how to run your tests by interepreting your .testr.conf file. +For instance:: [DEFAULT] test_command=foo $IDOPTION test_id_option=--bar $IDFILE will cause 'testr run' to run 'foo' and process it as 'testr load' would. -Likewise 'testr run --failing' will run 'foo --bar failing.list' and process it -as 'testr load' would. failing.list will be a newline separated list of the -test ids that your test runner outputs. Arguments passed to run are passed -through to your test runner command line. To pass options through to your test -running, use a ``--`` before your options. For instance, -``testr run quux -- bar --no-plugins`` would run -``foo quux bar --no-plugins`` using the above config example. Shell variables +Likewise 'testr run --failing' will automatically create a list file listing +just the failing tests, and then run 'foo --bar failing.list' and process it as +'testr load' would. failing.list will be a newline separated list of the +test ids that your test runner outputs. If there are no failing tests, no test +execution will happen at all. + +Arguments passed to 'testr run' are used to filter test ids that will be run - +testr will query the runner for test ids and then apply each argument as a +regex filter. Tests that match any of the given filters will be run. Arguments +passed to run after a ``--`` are passed through to your test runner command +line. For instance, using the above config example ``testr run quux -- bar +--no-plugins`` would query for test ids, filter for those that match 'quux' and +then run ``foo bar --load-list tempfile.list --no-plugins``. Shell variables are expanded in these commands on platforms that have a shell. -To get a full list of these options run ``testr help run``. - Having setup a .testr.conf, a common workflow then becomes:: # Fix currently broken tests - repeat until there are no failures. @@ -63,6 +91,35 @@ The --failing option turns on ``--partial`` automatically (so that if the partial test run were to be interrupted, the failing tests that aren't run are not lost). +Another common use case is repeating a failure that occured on a remote +machine (e.g. during a jenkins test run). There are two common ways to do +approach this. + +Firstly, if you have a subunit stream from the run you can just load it:: + + $ testr load < failing-stream + # Run the failed tests + $ testr run --failing + +The streams generated by test runs are in .testrepository/ named for their test +id - e.g. .testrepository/0 is the first stream. + +If you do not have a stream (because the test runner didn't output subunit or +you don't have access to the .testrepository) you may be able to use a list +file. If you can get a file that contains one test id per line, you can run +the named tests like this: + + $ testr run --load-list FILENAME + +This can also be useful when dealing with sporadically failing tests, or tests +that only fail in combination with some other test - you can bisect the tests +that were run to get smaller and smaller (or larger and larger) test subsets +until the error is pinpointed. + +``testr run --until-failure`` will run your test suite again and again and +again stopping only when interrupted or a failure occurs. This is useful +for repeating timing-related test failures. + Listing tests ~~~~~~~~~~~~~ @@ -81,10 +138,16 @@ will be passed through, if a test list is being supplied test_option can be used via $IDOPTION. The output of the test command when this option is supplied should be a series -of test ids, in any order, `\n' separated on stdout. +of test ids, in any order, ``\n`` separated on stdout. To test whether this is working the `testr list-tests` command can be useful. +You can also use this to see what tests will be run by a given testr run +command. For instance, the tests that ``testr run myfilter`` will run are shown +by ``testr list-tests myfilter``. As with 'run', arguments to 'list-tests' are +used to regex filter the tests of the test runner, and arguments after a '--' +are passed to the test runner. + Parallel testing ~~~~~~~~~~~~~~~~ @@ -95,9 +158,12 @@ then testr is able to run your tests in parallel:: This will first list the tests, partition the tests into one partition per CPU on the machine, and then invoke multiple test runners at the same time, with -each test runner getting one partition. A database of previous times for each -test is maintained, and the partitions are allocated roughly equal times based -on that historical record. +each test runner getting one partition. Currently the partitioning algorithm +is simple round-robin for tests that testr has not seen run before, and +equal-time buckets for tests that testr has seen run. NB: This uses the anydbm +Python module to store the duration of each test. On some platforms (to date +only OSX) there is no bulk-update API and performance may be impacted if you +have many (10's of thousands) of tests. On Linux, testrepository will inspect /proc/cpuinfo to determine how many CPUs are present in the machine, and run one worker per CPU. On other operating @@ -119,6 +185,24 @@ partition per test. For instance in .test.conf:: Would tell testr to use concurrency of 2. +When running tests in parallel, testrepository tags each test with a tag for +the worker that executed the test. The tags are of the form ``worker-%d`` and +are usually used to reproduce test isolation failures, where knowing exactly +what test ran on a given backend is important. + +To find out which slave a failing test ran on just look at the 'tags' line in +its test error:: + + ====================================================================== + label: testrepository.tests.ui.TestDemo.test_methodname + tags: foo worker-0 + ---------------------------------------------------------------------- + error text + +And then find tests with that tag:: + + $ testr last --subunit | subunit-filter -s --xfail --with-tag=worker-3 | subunit-ls > slave-3.list + Remote or isolated test environments ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -182,6 +266,49 @@ testr can ignore such tests if they are tagged, using the filter_tags configuration option. Tests tagged with any tag in that (space separated) list will only be included in counts and reports if the test failed (or errored). +Automated test isolation bisection +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +As mentioned above, its possible to manually analyze test isolation issues by +interrogating the repository for which tests ran on which worker, and then +creating a list file with those tests, re-running only half of them, checking +the error still happens, rinse and repeat. + +However that is tedious. testr can perform this analysis for you:: + + $ testr run --analyze-isolation + +will perform that analysis for you. (This requires that your test runner is +(mostly) deterministic on test ordering). The process is: + +1. The last run in the repository is used as a basis for analysing against - + tests are only cross checked against tests run in the same worker in that + run. This means that failures accrued from several different runs would not + be processed with the right basis tests - you should do a full test run to + seed your repository. This can be local, or just testr load a full run from + your Jenkins or other remote run environment. + +2. Each test that is currently listed as a failure is run in a test process + given just that id to run. + +3. Tests that fail are excluded from analysis - they are broken on their own. + +4. The remaining failures are then individually analysed one by one. + +5. For each failing, it gets run in one work along with the first 1/2 of the + tests that were previously run prior to it. + +6. If the test now passes, that set of prior tests are discarded, and the + other half of the tests is promoted to be the full list. If the test fails + then other other half of the tests are discarded and the current set + promoted. + +7. Go back to running the failing test along with 1/2 of the current list of + priors unless the list only has 1 test in it. If the failing test still + failed with that test, we have found the isolation issue. If it did not + then either the isolation issue is racy, or it is a 3-or-more test + isolation issue. Neither of those cases are automated today. + Repositories ~~~~~~~~~~~~ diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..4d42bd7 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,153 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make <target>' where <target> is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/TestRepository.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/TestRepository.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/TestRepository" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/TestRepository" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/doc/conf.py b/doc/conf.py new file mode 100644 index 0000000..c9076dd --- /dev/null +++ b/doc/conf.py @@ -0,0 +1,242 @@ +# -*- coding: utf-8 -*- +# +# Test Repository documentation build configuration file, created by +# sphinx-quickstart on Mon Dec 3 23:24:00 2012. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = [] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.txt' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'Test Repository' +copyright = u'2012, Testrepository Contributors' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = 'trunk' +# The full version, including alpha/beta/rc tags. +release = 'trunk' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# "<project> v<release> documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a <link> tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'TestRepositorydoc' + + +# -- Options for LaTeX output -------------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'TestRepository.tex', u'Test Repository Documentation', + u'Testrepository Contributors', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'testrepository', u'Test Repository Documentation', + [u'Testrepository Contributors'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------------ + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'TestRepository', u'Test Repository Documentation', + u'Testrepository Contributors', 'TestRepository', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' diff --git a/doc/index.txt b/doc/index.txt new file mode 100644 index 0000000..720cb5f --- /dev/null +++ b/doc/index.txt @@ -0,0 +1,25 @@ +.. Test Repository documentation master file, created by + sphinx-quickstart on Mon Dec 3 23:24:00 2012. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Test Repository's documentation! +=========================================== + +Contents: + +.. toctree:: + :maxdepth: 2 + + MANUAL + DESIGN + DEVELOPERS + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`search` + diff --git a/doc/make.bat b/doc/make.bat new file mode 100644 index 0000000..fd4663f --- /dev/null +++ b/doc/make.bat @@ -0,0 +1,190 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=_build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . +set I18NSPHINXOPTS=%SPHINXOPTS% . +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^<target^>` where ^<target^> is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\TestRepository.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\TestRepository.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +:end |