This directory contains the primary doconce tests.

There are three types of tests:

 * regression suite in tests.py 
 * unit tests in test_run.py
 * unit tests in test_mintest.py


The regression suite in tests.py contains classical 
regression tests where text is generated in many files 
(stored in the testv directory or concatenated in the 
test.v file) that can be compared with reference ones 
(in the testr directory or in the test.r file).

The unit tests in test_run.py (work in progress!) can be run with

  pytest -v test_run.py

The unit tests are in test_mintest.py (very minimalistic tests,
mainly to check that the installation of DocOnce itself is okay). Run
by

  py.test test_mintest.py

-----------------------------------------------------------------------

The very regression suite in tests.py is run by

  python tests.py

Don't run this unless you have a complete installation with all the 
DocOnce dependencies (see the requirements.txt file). This script 
uses make.sh to run doconce commands. The generated texts are copied 
over to the testv folder, which can be compared with reference ones 
in the testr folder. Alternatively, all generated texts are collected 
in the test.v test.r file. 


-----------------------------------------------------------------------

Note by hpl:

Standard unit tests with nose/pytest are less suitable for a
text transformation program such as DocOnce. The reason is that some
functionality must be tested in larger files where many constructions
play together. Also, test files are frequently changed to add new
constructions, or test the effect of bug fixes, leading to a substantial
evolution of the reference text. At least for a small project as
DocOnce, this has turned out to be the most feasible testing approach.
Basically, `python test.py` is run and `test.v` is compared against
`test.r` in a diff program, using the human eye (because many updates lead
to significant changes in the diff that require a human to approve).
