[vtk-developers] [HEADSUP] New testing macros
Ben Boeckel
ben.boeckel at kitware.com
Wed Apr 16 14:44:24 EDT 2014
Hi all,
I've just merged a reworking of the testing macros into master. It makes
them more consistent and makes the code for option parsing much saner.
Changes to note:
- vtk_add_test_cxx now takes a specified executable name and a
variable to place the list of tests in. This is so that custom tests
may be added more easily rather than having to manipulate a magic
directory property.
Before:
vtk_add_test_cxx(
NO_VALID
A.cxx,NO_DATA
B.cxx)
vtk_test_cxx_executable(${vtk-module}CxxTests)
After:
vtk_add_test_cxx(${vtk-module}CxxTests tests
NO_VALID
A.cxx,NO_DATA
B.cxx)
vtk_test_cxx_executable(${vtk-module}CxxTests tests)
Adding a test to the executable is as easy as:
list(APPEND tests
mycustomtest)
but this should be used sparingly (VTK doesn't have any instances of
this). It is mainly used to support cases such as:
vtk_add_test_cxx(${vtk-module}CxxTests data_tests
A.cxx
B.cxx)
vtk_add_test_cxx(${vtk-module}CxxTests no_data_tests
NO_DATA
C.cxx
D.cxx)
set(all_tests ${data_tests} ${no_data_tests})
vtk_test_cxx_executable(${vtk-module}CxxTests all_tests)
- MPI tests now work like C++ tests:
Before:
vtk_add_test_mpi(A.cxx TESTING_DATA)
vtk_add_test_mpi(B.cxx)
After:
vtk_add_test_mpi(${vtk-module}CxxTests-MPI tests
A.cxx,TESTING_DATA
B.cxx
)
vtk_test_mpi_executable(${vtk-module}CxxTests-MPI tests)
- Python and Tcl tests may be merged into a single call:
Before:
vtk_add_test_python(A.py NO_RT NO_OUTPUT)
vtk_add_test_python(B.py NO_RT NO_OUTPUT)
vtk_add_test_python(C.py NO_DATA NO_RT NO_OUTPUT)
After:
vtk_add_test_python(
NO_RT NO_OUTPUT
A.py
B.py
C.py,NO_DATA0
Python tests also now recognize the JUST_VALID to suppress the -A
argument when not using NO_RT (required for some ParaView tests).
- There are now Python/MPI tests. vtk_add_test_python_mpi works just
like the vtk_add_test_python function except there is an "-MPI"
added to the test name.
- Tests now recognize module-level arguments. For example,
set(${vtk-module}_NUMPROCS 4)
set(${vtk-module}_ARGS --some-needed=argument)
rather than setting the same arguments per-test.
- The -E flag is no longer recognized as a test "option". Pass it as a
separate argument instead. This is because it was used in all of 2
modules for 12 tests total and would have required significant extra
code or special casing in the argument parsing.
- Test labels may now be applied using the TEST_LABELS option to your
vtk_module declaration (only used in ParaView currently).
- The VTKExternalData_OBJECT_STORES environment variable may be used
to direct VTK's data somewhere other than any global directory the
ExternalData_OBJECT_STORES environment may point to.
Thanks,
--Ben
More information about the vtk-developers
mailing list