mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-12 17:19:05 -05:00
CPack: extend testing framework
Some CPack tests require running commands after the inclusion of CPack.cmake and this patch enables such tests to declare run_after_include_cpack function which is run after the inclusion.
This commit is contained in:
@@ -15,3 +15,7 @@ include(tests/${RunCMake_TEST_FILE_PREFIX}/test.cmake)
|
||||
|
||||
set(CPACK_GENERATOR "${GENERATOR_TYPE}")
|
||||
include(CPack)
|
||||
|
||||
if(COMMAND run_after_include_cpack)
|
||||
run_after_include_cpack()
|
||||
endif()
|
||||
|
||||
@@ -91,6 +91,11 @@ If test will be used for multiple generators but some of them require some
|
||||
generator specific commands then those commands should be added to 'test.cmake'
|
||||
script wrapped with 'if(GENERATOR_TYPE STREQUAL <name_of_the_generator>)'.
|
||||
|
||||
NOTE: In some cases (for example when testing CPackComponent.cmake functions)
|
||||
the test has to run some functions after CPack.cmake is included. In such cases
|
||||
a function run_after_include_cpack can be declared in test.cmake file and that
|
||||
function will run after the inclusion of CPack.cmake.
|
||||
|
||||
build phase (optional and not available for source package tests)
|
||||
-----------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user