Add infrastructure for CMakeCommands tests
Generalize the build_command test framework as a macro to add the test. Process the CMakeCommands subdirectory explicitly.
This commit is contained in:
parent
d03606a19c
commit
5e1a5c44da
|
@ -0,0 +1,10 @@
|
||||||
|
macro(add_CMakeCommands_test test)
|
||||||
|
add_test(CMakeCommands.${test} ${CMAKE_CMAKE_COMMAND}
|
||||||
|
-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR} # TODO: Remove
|
||||||
|
-Ddir=${CMAKE_CURRENT_BINARY_DIR}/${test}
|
||||||
|
-Dgen=${CMAKE_TEST_GENERATOR}
|
||||||
|
-P "${CMAKE_CURRENT_SOURCE_DIR}/${test}/test.cmake"
|
||||||
|
)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
add_CMakeCommands_test(build_command)
|
|
@ -48,6 +48,7 @@ IF(BUILD_TESTING)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(CMakeLib)
|
ADD_SUBDIRECTORY(CMakeLib)
|
||||||
ADD_SUBDIRECTORY(CMakeOnly)
|
ADD_SUBDIRECTORY(CMakeOnly)
|
||||||
|
ADD_SUBDIRECTORY(CMakeCommands)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(FindPackageModeMakefileTest)
|
ADD_SUBDIRECTORY(FindPackageModeMakefileTest)
|
||||||
|
|
||||||
|
@ -1695,13 +1696,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
|
||||||
add_config_tests(Release)
|
add_config_tests(Release)
|
||||||
add_config_tests(RelWithDebInfo)
|
add_config_tests(RelWithDebInfo)
|
||||||
|
|
||||||
add_test(CMakeCommands.build_command ${CMAKE_CMAKE_COMMAND}
|
|
||||||
-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}
|
|
||||||
-Ddir=${CMake_BINARY_DIR}/Tests/CMakeCommands/build_command
|
|
||||||
-Dgen=${CMAKE_TEST_GENERATOR}
|
|
||||||
-P "${CMake_SOURCE_DIR}/Tests/CMakeCommands/build_command/RunCMake.cmake"
|
|
||||||
)
|
|
||||||
|
|
||||||
ADD_TEST_MACRO(CMakeCommands.target_link_libraries target_link_libraries)
|
ADD_TEST_MACRO(CMakeCommands.target_link_libraries target_link_libraries)
|
||||||
|
|
||||||
CONFIGURE_FILE(
|
CONFIGURE_FILE(
|
||||||
|
|
Loading…
Reference in New Issue