diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-11-08 22:59:58 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-11-08 22:59:58 (GMT) |
commit | 1de28a762f96f7c23f459df4a0cf9cfccdc1a034 (patch) | |
tree | 17906d38e6a8b002a9083ae09260400cf89d6074 | |
parent | 34e78344516f1ddc8951ab3087fa8c6263021087 (diff) | |
download | CMake-1de28a762f96f7c23f459df4a0cf9cfccdc1a034.zip CMake-1de28a762f96f7c23f459df4a0cf9cfccdc1a034.tar.gz CMake-1de28a762f96f7c23f459df4a0cf9cfccdc1a034.tar.bz2 |
ENH: Add test for output regular expression
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Source/kwsys/testRegistry.cxx | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 38254b1..d2be205 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -650,11 +650,13 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) ADD_TEST(kwsys.testProcess-7 ${EXEC_DIR}/testProcess 7) ADD_TEST(kwsys.testHashSTL ${EXEC_DIR}/testHashSTL) ADD_TEST(kwsys.testRegistry ${EXEC_DIR}/testRegistry) - IF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) + IF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE) ADD_TEST(kwsys.testFail ${EXEC_DIR}/testFail) SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES WILL_FAIL ON) GET_TEST_PROPERTY(kwsys.testFail WILL_FAIL wfv) + SET_TESTS_PROPERTIES(kwsys.testRegistry PROPERTIES ERROR_REGULAR_EXPRESSION "ERROR\$;FAIL;Test failed") + SET_TESTS_PROPERTIES(kwsys.testRegistry PROPERTIES REQUIRED_REGULAR_EXPRESSION "Test passed") MESSAGE(STATUS "GET_TEST_PROPERTY returned: ${wfv}") - ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) + ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE) ENDIF(BUILD_TESTING) ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) diff --git a/Source/kwsys/testRegistry.cxx b/Source/kwsys/testRegistry.cxx index b808f11..1c31163 100644 --- a/Source/kwsys/testRegistry.cxx +++ b/Source/kwsys/testRegistry.cxx @@ -103,5 +103,9 @@ int main(int, char**) { kwsys_ios::cout << "Test failed" << kwsys_ios::endl; } + else + { + kwsys_ios::cout << "Test passed" << kwsys_ios::endl; + } return res; } |