The parent directory's may need to descend into a tests directory, for example:

SUBDIRS = tests

If the code needs to be built prior to test code, you can do current directory (.) first, like:

SUBDIRS = . tests

Python tests

The following is example code:

# later will have configure option to choose this, like: coverage run --branch

# test using command-line arguments, so use check-local target instead of TESTS
      for pytest in $(PYTESTS) ; do \
      echo Running test: $$pytest ; \
      env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/bin/FOO \
      $(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \

Python tests are included in the release tarball by adding EXTRA_DIST to the respective tests The PYCOVERAGE is set to python by default, but may be set to py-coverage (coverage) instead. (This will be documented later.) Set the PYTHONPATH as needed (see FOO). Later will add to this example steps for python coverage testing and/or will create a generic macro or include files for this.

C++ tests

The GoogleTest-based tests already are included in the tarball (when using TESTS and foo_SOURCES), but you do need to use EXTRA_DIST to include data file or other supplementary testing files to the release tarball.

Last modified 7 years ago Last modified on Jun 30, 2010, 4:35:49 PM