Changes between Version 2 and Version 3 of Tests


Ignore:
Timestamp:
Jun 30, 2010, 4:35:49 PM (7 years ago)
Author:
jreed
Comment:

reorder, add more details

Legend:

Unmodified
Added
Removed
Modified
  • Tests

    v2 v3  
    1 Python tests may be included in the release tarball by adding EXTRA_DIST to the respective tests Makefile.am, for example:
    2 
    3 {{{
    4 EXTRA_DIST = unittest_fakesession.py
    5 }}}
    6 
    7 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.
    8 
    9 In addition, the parent directory's Makefile.am may need to descend into it, for example:
     1The parent directory's Makefile.am may need to descend into a tests directory, for example:
    102
    113{{{
    124SUBDIRS = tests
    135}}}
     6
     7If the code needs to be built prior to test code, you can do current directory (.) first, like:
     8
     9{{{
     10SUBDIRS = . tests
     11}}}
     12
     13== Python tests ==
     14
     15The following is example Makefile.am code:
     16
     17{{{
     18# later will have configure option to choose this, like: coverage run --branch
     19PYCOVERAGE = $(PYTHON)
     20#PYCOVERAGE=@PYCOVERAGE@
     21PYTESTS = foo_test.py
     22EXTRA_DIST = $(PYTESTS)
     23
     24# test using command-line arguments, so use check-local target instead of TESTS
     25check-local:
     26      for pytest in $(PYTESTS) ; do \
     27      echo Running test: $$pytest ; \
     28      env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/bin/FOO \
     29      $(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
     30      done
     31}}}
     32
     33Python tests are included in the release tarball by adding EXTRA_DIST to the respective tests Makefile.am.
     34The PYCOVERAGE is set to python by default, but may be set to py-coverage (coverage) instead. (This will be documented later.)
     35Set the PYTHONPATH as needed (see FOO).
     36Later will add to this example steps for python coverage testing and/or will create a generic Makefile.am macro or include files for this.
     37
     38== C++ tests ==
     39
     40The !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.