ENH: Add test for output regular expression
This commit is contained in:
parent
34e7834451
commit
1de28a762f
|
@ -650,11 +650,13 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
|
||||||
ADD_TEST(kwsys.testProcess-7 ${EXEC_DIR}/testProcess 7)
|
ADD_TEST(kwsys.testProcess-7 ${EXEC_DIR}/testProcess 7)
|
||||||
ADD_TEST(kwsys.testHashSTL ${EXEC_DIR}/testHashSTL)
|
ADD_TEST(kwsys.testHashSTL ${EXEC_DIR}/testHashSTL)
|
||||||
ADD_TEST(kwsys.testRegistry ${EXEC_DIR}/testRegistry)
|
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)
|
ADD_TEST(kwsys.testFail ${EXEC_DIR}/testFail)
|
||||||
SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES WILL_FAIL ON)
|
SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES WILL_FAIL ON)
|
||||||
GET_TEST_PROPERTY(kwsys.testFail WILL_FAIL wfv)
|
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}")
|
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(BUILD_TESTING)
|
||||||
ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
|
ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
|
||||||
|
|
|
@ -103,5 +103,9 @@ int main(int, char**)
|
||||||
{
|
{
|
||||||
kwsys_ios::cout << "Test failed" << kwsys_ios::endl;
|
kwsys_ios::cout << "Test failed" << kwsys_ios::endl;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
kwsys_ios::cout << "Test passed" << kwsys_ios::endl;
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue