ENH: Add test for output regular expression

This commit is contained in:
Andy Cedilnik 2005-11-08 17:59:58 -05:00
parent 34e7834451
commit 1de28a762f
2 changed files with 8 additions and 2 deletions

View File

@ -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)

View File

@ -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;
}