diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2010-09-02 15:34:13 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2010-09-02 15:34:13 (GMT) |
commit | f047a17c5910cec1c0b9c20acb74510747ce6ba1 (patch) | |
tree | b7d214b7ca2f1a70d9dd9f7339d9f25917ec1a0d /Tests | |
parent | 75bda3864ea033f976773df80f22fea2992a165d (diff) | |
download | CMake-f047a17c5910cec1c0b9c20acb74510747ce6ba1.zip CMake-f047a17c5910cec1c0b9c20acb74510747ce6ba1.tar.gz CMake-f047a17c5910cec1c0b9c20acb74510747ce6ba1.tar.bz2 |
Add test for uninitialized variables
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 6415472..481be09 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1102,6 +1102,19 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ FAIL_REGULAR_EXPRESSION "warning: The variable, \"USED_VARIABLE\"") LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUsed") + ADD_TEST(WarnUninitialized ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/VariableUsage" + "${CMake_BINARY_DIR}/Tests/WarnUninitialized" + --build-generator ${CMAKE_TEST_GENERATOR} + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-noclean + --build-project WarnUninitialized + --build-options "--warn-uninitialized") + SET_TESTS_PROPERTIES(WarnUninitialized PROPERTIES + PASS_REGULAR_EXPRESSION "warning: uninitialized variable 'USED_VARIABLE'") + LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUninitialized") + # Make sure CTest can handle a test with no newline in output. ADD_TEST(CTest.NoNewline ${CMAKE_CMAKE_COMMAND} -E echo_append "This line has no newline!") |