The src/tests directory contains the unit tests for the project.
__init__.py
- Initialize tests as a packageMakefile
- Used bymake
(see Make Commands below)README.md
- This document*.py
- Unit testsexpected/
- Expected *.txt, *.tex, and *.pdf filesoutput/
- Output *.txt, *.tex, and *.pdf files (make test
ormake coverage
)utils/
- Test utilities
The following make targets are available:
make help
- Print this helpmake all
- Make coverage and output-pdfs targetsmake view
- Make all. View HTML coverage reportmake test
- Run Python unit testsmake coverage
- Run tests and generate HTML coverage reportmake expected-pdfs
- Process all LaTeX files in ./expectedmake output-pdfs
- Process all LaTeX files in ./outputmake clean
- Remove intermediate LaTeX filesmake distclean
- Remove all generated filesmake maintainer-clean
- Remove all generated files
To run tests and view the HTML coverage report:
make view
To simply view the HTML coverage report:
open ../htmlcov/index.html
To make PDFs in the src/tests/expected directory:
make expected-pdfs
To make PDFs in the src/tests/output directory:
make output-pdfs
after you've created required LaTeX inputs via make test
or make coverage
The make all
command effectively runs make coverage
followed by make output-pdfs
. The make all
command
doesn't make expected-pdfs
. If you want PDFs in the
src/tests/expected directory, use make expected-pdfs
.
If we could be certain that our QA team would approve (without manually inspecting) the entire content of ./output after "make all", then we would allow replacing ./expected by a copy of ./output which is followed by a "make distclean" in ./expected . Instead, the process is to "make distclean" followed by a phone call to the QA Team who will take it from there.
The src/tests/output README.md and Makefile are identical to the src/tests/expected README.md and Makefile by design. Even though they do say "expected" in their text and source code, these duplicate files are applicable to and can be used in the "output" directory.