Tests: Fix test_clean target missing some test directories

This commit is contained in:
Craig Scott 2020-02-15 13:19:34 +11:00
parent 125f0451a9
commit afc8956765
3 changed files with 16 additions and 11 deletions

View File

@ -3423,17 +3423,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
set_tests_properties ( KDELibsAlpha1 PROPERTIES TIMEOUT 5400)
endif()
# If this is not an in-source build, provide a target to wipe out
# all the test build directories.
if(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
configure_file(${CMake_SOURCE_DIR}/Tests/test_clean.cmake.in
${CMake_BINARY_DIR}/Tests/test_clean.cmake @ONLY)
add_custom_target(test_clean
COMMAND ${CMAKE_COMMAND} -P ${CMake_BINARY_DIR}/Tests/test_clean.cmake
COMMENT "Removing test build directories."
)
endif()
# Define a set of "contract" tests, each activated by a cache entry
# named "CMake_TEST_CONTRACT_<project>". For each Contract test,
# the project should provide a directory with a CMakeLists.txt file
@ -3508,4 +3497,16 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
if(NOT CMake_TEST_EXTERNAL_CMAKE)
add_subdirectory(CMakeTests)
endif()
# If this is not an in-source build, provide a target to wipe out
# all the test build directories. This must come at the end after
# all the above logic has finished adding to TEST_BUILD_DIRS
if(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
configure_file(${CMake_SOURCE_DIR}/Tests/test_clean.cmake.in
${CMake_BINARY_DIR}/Tests/test_clean.cmake @ONLY)
add_custom_target(test_clean
COMMAND ${CMAKE_COMMAND} -P ${CMake_BINARY_DIR}/Tests/test_clean.cmake
COMMENT "Removing test build directories."
)
endif()
endif()

View File

@ -7,3 +7,5 @@ ADD_AUTOGEN_TEST(DefinesTest)
# Common tests
include("../QtAutogen/Tests.cmake")
set(TEST_BUILD_DIRS "${TEST_BUILD_DIRS}" PARENT_SCOPE)

View File

@ -4,3 +4,5 @@ include("../QtAutogen/TestMacros.cmake")
# Common tests
include("../QtAutogen/Tests.cmake")
set(TEST_BUILD_DIRS "${TEST_BUILD_DIRS}" PARENT_SCOPE)