diff options
author | David Cole <dcole@neocisinc.com> | 2013-08-28 03:47:36 (GMT) |
---|---|---|
committer | David Cole <dcole@neocisinc.com> | 2013-08-28 21:22:49 (GMT) |
commit | b49472264213b2d829e7c6d118660190f5238a14 (patch) | |
tree | 543d29fa4f8a0f6de0a1730c4d97c52ae3413266 /Tests/CMakeTests/CMakeLists.txt | |
parent | b15ad0d1de7524be3b32d6691b68d3578ee00ca5 (diff) | |
download | CMake-b49472264213b2d829e7c6d118660190f5238a14.zip CMake-b49472264213b2d829e7c6d118660190f5238a14.tar.gz CMake-b49472264213b2d829e7c6d118660190f5238a14.tar.bz2 |
Tests: Verify policies are introduced only in "official" versions
Add the CMake.PolicyCheck test.
This test uses "git grep" to look for policies added in a "dated"
version of CMake. It will fail if a policy is added as of,
for example, CMake 2.8.11.20130828.
The intent is to prevent such constructs from making it into an
"official" release. Three instances actually appeared in the first
attempted release candidate for 2.8.12.
This test may sometimes yield false positives. After all, it's just
using a regular expression to detect this condition, and something
in a comment could possibly match it. As of right now, that's not
true, but it's easy to imagine such a comment being added.
The new test may also not catch all future problems of this sort.
However, it will catch problems of this sort for all code that follows
the present layout style in Source/cmPolicies.cxx.
Diffstat (limited to 'Tests/CMakeTests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeTests/CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt index 344b772..4c49c6a 100644 --- a/Tests/CMakeTests/CMakeLists.txt +++ b/Tests/CMakeTests/CMakeLists.txt @@ -55,6 +55,15 @@ set(GetPrerequisites_PreArgs ) AddCMakeTest(GetPrerequisites "${GetPrerequisites_PreArgs}") +if(GIT_EXECUTABLE) + set(PolicyCheck_PreArgs + "-DCMake_BINARY_DIR:PATH=${CMake_BINARY_DIR}" + "-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}" + "-DGIT_EXECUTABLE:STRING=${GIT_EXECUTABLE}" + ) + AddCMakeTest(PolicyCheck "${PolicyCheck_PreArgs}") +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. |