Difference between revisions of "Documentation/Nightly/Developers/FAQ/Testing"
From Slicer Wiki
Line 31: | Line 31: | ||
** Slicer arguments systematically passed are <code>--testing</code> and <code>--no-splash</code>. | ** Slicer arguments systematically passed are <code>--testing</code> and <code>--no-splash</code>. | ||
** Conveniently call [https://cmake.org/cmake/help/latest/module/ExternalData.html#command:externaldata_add_test ExternalData_add_test] with the appropriate parameters. | ** Conveniently call [https://cmake.org/cmake/help/latest/module/ExternalData.html#command:externaldata_add_test ExternalData_add_test] with the appropriate parameters. | ||
+ | |||
+ | == What is the meaning of prefix py_ in test name ? == | ||
+ | |||
+ | It means that the test is implemented in python. |
Latest revision as of 14:47, 11 July 2016
Home < Documentation < Nightly < Developers < FAQ < Testing
For the latest Slicer documentation, visit the read-the-docs. |
Contents
Testing
What is the difference between add_test, simple_test, slicer_add_python_test, and slicer_add_python_unittest CMake macros/functions ?
simple_test(testname)
:- Usually called after configuring a test driver using
SlicerMacroConfigureModuleCxxTestDriver
. - Accept the same arguments as
add_test
. - Conveniently call ExternalData_add_test with the appropriate parameters.
- Set the
LABELS
test property. - Invoke test driver using
${Slicer_LAUNCH_COMMAND}
- Usually called after configuring a test driver using
slicer_add_python_unittest(SCRIPT script [TESTNAME_PREFIX prefix] [SLICER_ARGS slicer_arg1 [slicer_arg2 [...]]])
:- Run unittests with Slicer using
--python-code "import slicer.testing\\; slicer.testing.runUnitTest(['${CMAKE_CURRENT_BINARY_DIR}', '${_script_source_dir}'], '${test_name}')"
. - Slicer arguments systematically passed are
--testing
and--no-splash
. - Conveniently call ExternalData_add_test with the appropriate parameters.
- Run unittests with Slicer using
slicer_add_python_test(SCRIPT script [TESTNAME_PREFIX prefix] [SLICER_ARGS slicer_arg1 [slicer_arg2 [...]]] [SCRIPT_ARGS script_arg1 [script_arg2 [..]]])
:- Useful to run a python test that can not be added as a unittest.
- Run Slicer with the given
script
. - Slicer arguments systematically passed are
--testing
and--no-splash
. - Conveniently call ExternalData_add_test with the appropriate parameters.
What is the meaning of prefix py_ in test name ?
It means that the test is implemented in python.