diff options
author | Brad King <brad.king@kitware.com> | 2022-10-05 14:42:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-10-05 16:38:12 (GMT) |
commit | 8d453ee751e9610f8b4e0a1b1fd65cb3b080c3dc (patch) | |
tree | dc9d3bfdccc971eb555377d26c258dd843b96ed3 /Tests/CMakeLists.txt | |
parent | c23ebfa333208df8730a2c84635faf11fc7ad669 (diff) | |
download | CMake-8d453ee751e9610f8b4e0a1b1fd65cb3b080c3dc.zip CMake-8d453ee751e9610f8b4e0a1b1fd65cb3b080c3dc.tar.gz CMake-8d453ee751e9610f8b4e0a1b1fd65cb3b080c3dc.tar.bz2 |
Tests: Improve CheckSourceTree test
Re-implement the test using simpler approach. Enable it only when doing
an out-of-source build with a `.git` source. Run it last, serially.
Re-use the `git` tool found for version computation. Print the output
from `git status` without modification. Rely on `.gitignore` instead
of filtering out paths ourselves.
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index da87213..10242fd 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -3616,6 +3616,14 @@ if(BUILD_TESTING) add_subdirectory(CMakeGUI) endif() + # Run CheckSourceTree as the very last test in the CMake/CTest/CPack test + # suite. It detects if any changes have been made to the CMake source tree + # by any previous configure, build or test steps. + if(GIT_EXECUTABLE AND EXISTS "${CMake_SOURCE_DIR}/.git" + AND NOT "${CMake_SOURCE_DIR}" STREQUAL "${CMake_BINARY_DIR}") + add_subdirectory(CheckSourceTree) + 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 |