Bootstrap Templates
CMakeTest tests cannot be executed directly
by CTest but instead require a bootstrap file to setup
the CMakeTest runtime. These bootstrap files are configured
at build time. The template these files are configured from is
cmake_test/templates/lists.txt. The file is listed below for
convenience.
The variables that are inserted into the template are as follows:
_ct_min_cmake_version: The minimum version of CMake required by CMakeTest. This variable is generally set by CMakeTest’sCMakeLists.txt_ad_test_file: The file that contains the tests that this template bootstraps. This variable is generally set byct_add_dir.CMAKETEST_USE_COLORS: The option for whether to use colors that is propagated to the test. This variable is an option initially set by thecmake_test/colorsmodule but can be changed at configure time by the user.CMAKEPP_LANG_DEBUG_MODE: The option for whether CMakePPLang should run in debug mode. This option is treated specially because CMakeTest uses CMakePPLang internally, and enabling debug mode while running tests significantly impacts performance.CT_PRINT_LENGTH: The variable for the print length of pass/fail lines when not overridden by the test. This variable is only set if the user overrides the default of 80 via thect_set_print_lengthfunction or if thePRINT_LENGTHoption is passed toct_add_testorct_add_sectionfunctions.CMAKE_MODULE_PATH: This is the same module path list as used in normal CMake code, it is propagated down to prevent any module not found errors.
CMakeTest uses a second bootstrap file specifically
for executing EXPECTFAIL tests in a subprocess. These files
are configured at test time from the cmake_test/templates/expectfail.txt
template. The file is listed below for convenience.
The variables that are inserted into the template are as follows:
_ct_min_cmake_version: The minimum version of CMake required by CMakeTest. This variable is generally set by CMakeTest’sCMakeLists.txt.ct_debug_mode: Whether CMakeTest itself should be debugged. This variable is stored in a CMakePP global calledCT_DEBUG_MODE`, and is by default set to the value of ``CMAKEPP_LANG_DEBUG_MODEupon inclusion ofcmake_test/cmake_testat configure time.CMAKETEST_USE_COLORS: The option for whether to use colors that is propagated to the test. This variable is an option initially set by thecmake_test/colorsmodule but can be changed at configure time by the user.CT_PRINT_LENGTH: The variable for the print length of pass/fail lines when not overridden by the test. This variable is only set if the user overrides the default of 80 via thect_set_print_lengthfunction or if thePRINT_LENGTHoption is passed toct_add_testorct_add_sectionfunctions.CMAKE_MODULE_PATH: This is the same module path list as used in normal CMake code, it is propagated down to prevent any module not found errors._es_section_file: The containing file of the section._es_section_id_defines: A string containing CMake code that sets variables for test and section names to their current IDs. This determines which tests and sections are executed, as only units with a defined ID are executed whenCT_EXEC_EXPECTFAILis true.