From f047a17c5910cec1c0b9c20acb74510747ce6ba1 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 2 Sep 2010 11:34:13 -0400 Subject: Add test for uninitialized variables --- Tests/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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!") -- cgit v0.12