ENH: Change flag to PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION and add help in cmSetTestsPropertiesCommand

This commit is contained in:
Andy Cedilnik 2005-11-09 11:07:36 -05:00
parent a285a90809
commit 4e9d832525
3 changed files with 12 additions and 6 deletions

View File

@ -1558,7 +1558,7 @@ bool cmCTestTestHandler::SetTestsProperties(const std::vector<std::string>& args
{
rtit->m_WillFail = cmSystemTools::IsOn(val.c_str());
}
if ( key == "ERROR_REGULAR_EXPRESSION" )
if ( key == "FAIL_REGULAR_EXPRESSION" )
{
std::vector<std::string> lval;
cmSystemTools::ExpandListArgument(val.c_str(), lval);
@ -1568,7 +1568,7 @@ bool cmCTestTestHandler::SetTestsProperties(const std::vector<std::string>& args
rtit->m_ErrorRegularExpressions.push_back(cmsys::RegularExpression(crit->c_str()));
}
}
if ( key == "REQUIRED_REGULAR_EXPRESSION" )
if ( key == "PASS_REGULAR_EXPRESSION" )
{
std::vector<std::string> lval;
cmSystemTools::ExpandListArgument(val.c_str(), lval);

View File

@ -53,8 +53,14 @@ public:
{
return
" SET_TESTS_PROPERTIES(test1 [test2...] PROPERTIES prop1 value1 prop2 value2)\n"
"Set a property for the tests. If the "
"property is not found, CMake will report an error.";
"Set a property for the tests. If the property is not found, CMake will "
"report an error. The properties include:\n"
" WILL_FAIL if set to true, this will invert the pass/fail flag of the test.\n"
" PASS_REGULAR_EXPRESSION if set, the test output will be checked "
"against the specified regular expressions and at least one of the regular "
"expressions has to match, otherwise the test will fail.\n"
" FAIL_REGULAR_EXPRESSION if set, if the output will match to one of "
"specified regular expressions, the test will fail.";
}
cmTypeMacro(cmSetTestsPropertiesCommand, cmCommand);

View File

@ -654,8 +654,8 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
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")
SET_TESTS_PROPERTIES(kwsys.testRegistry PROPERTIES FAIL_REGULAR_EXPRESSION "ERROR;FAIL;Test failed")
SET_TESTS_PROPERTIES(kwsys.testRegistry PROPERTIES PASS_REGULAR_EXPRESSION "Test passed")
MESSAGE(STATUS "GET_TEST_PROPERTY returned: ${wfv}")
ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE)
ENDIF(BUILD_TESTING)