# test - runs a minimal set of tests
#
# setup_tests - sets up the testsuite subprojects
+# regen_tests - rerun configure stage in every testsuite subprojects
# clean_tests - runs the 'clean' target in every testsuite subproject
# prune_tests - removes all testsuite subprojects
#
TEST_PICKUP_REGEX
TEST_OVERRIDE_LOCATION
)
- IF(NOT "$ENV{${_var}}" STREQUAL "")
- # Environment always wins:
+ # Environment wins:
+ IF(DEFINED ENV{${_var}})
SET(${_var} $ENV{${_var}})
ENDIF()
IF(NOT "${_var}" STREQUAL "")
Setup can be fine-tuned using the following commands:
<pre>
+ $ make regen_tests - reruns configure stage in every testsuite subproject
+
$ make clean_tests - runs the 'clean' target in every testsuite subproject
$ make prune_tests - removes all testsuite subprojects
</pre>
</p>
- <p>
- <b>Note:</b> The subprojects cache these options (regardless of set
- via environment variables or as cmake variable). So, if you want to
- disable an option again, you have to either explicitly set it to an
- empty string or first remove the subprojects via
- <code>make prune_tests</code>.
- </p>
-
<a name="run"></a>
<h2>Running the testsuite</h2>
# Setup tests:
ADD_CUSTOM_TARGET(setup_tests)
+# Regenerate tests (run "make rebuild_cache" in subprojects):
+ADD_CUSTOM_TARGET(regen_tests)
+
# Clean all tests
ADD_CUSTOM_TARGET(clean_tests)
TEST_PICKUP_REGEX
TEST_TIME_LIMIT
)
+ # always undefine:
+ LIST(APPEND _options "-U${_var}")
IF(DEFINED ${_var})
LIST(APPEND _options "-D${_var}=${${_var}}")
ENDIF()
# depend on a valid build directory:
ADD_DEPENDENCIES(setup_tests_${_category} setup_build_dir)
+ ADD_CUSTOM_TARGET(regen_tests_${_category}
+ COMMAND [ ! -d ${_category} ] || ${CMAKE_COMMAND}
+ --build ${CMAKE_CURRENT_BINARY_DIR}/${_category} --target regenerate
+ > /dev/null # Shoo!
+ )
+ ADD_DEPENDENCIES(regen_tests regen_tests_${_category})
+
ADD_CUSTOM_TARGET(clean_tests_${_category}
COMMAND [ ! -d ${_category} ] || ${CMAKE_COMMAND}
--build ${CMAKE_CURRENT_BINARY_DIR}/${_category} --target clean