ENH: fix failing test when valgrind is on
This commit is contained in:
parent
4710c7aef6
commit
797db515a0
|
@ -655,11 +655,11 @@ void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it,
|
|||
|
||||
cres.ExecutionTime = (double)(clock_finish - clock_start);
|
||||
cres.FullCommandLine = testCommand;
|
||||
|
||||
std::string reason;
|
||||
if ( !this->CTest->GetShowOnly() )
|
||||
{
|
||||
bool testFailed = false;
|
||||
std::vector<cmsys::RegularExpression>::iterator passIt;
|
||||
std::vector<std::pair<cmsys::RegularExpression,std::string> >::iterator passIt;
|
||||
bool forceFail = false;
|
||||
if ( it->RequiredRegularExpressions.size() > 0 )
|
||||
{
|
||||
|
@ -668,13 +668,17 @@ void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it,
|
|||
passIt != it->RequiredRegularExpressions.end();
|
||||
++ passIt )
|
||||
{
|
||||
if ( passIt->find(output.c_str()) )
|
||||
if ( passIt->first.find(output.c_str()) )
|
||||
{
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if ( !found )
|
||||
{
|
||||
{
|
||||
reason = "Required regular expression not found.";
|
||||
reason += "Regex=[";
|
||||
reason += passIt->second;
|
||||
reason += "]";
|
||||
forceFail = true;
|
||||
}
|
||||
}
|
||||
|
@ -684,8 +688,12 @@ void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it,
|
|||
passIt != it->ErrorRegularExpressions.end();
|
||||
++ passIt )
|
||||
{
|
||||
if ( passIt->find(output.c_str()) )
|
||||
if ( passIt->first.find(output.c_str()) )
|
||||
{
|
||||
reason = "Error regular expression found in output.";
|
||||
reason += " Regex=[";
|
||||
reason += passIt->second;
|
||||
reason += "]";
|
||||
forceFail = true;
|
||||
}
|
||||
}
|
||||
|
@ -701,7 +709,7 @@ void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it,
|
|||
cmCTestLog(this->CTest, HANDLER_OUTPUT, " - But it should fail!");
|
||||
cres.Status = cmCTestTestHandler::FAILED;
|
||||
testFailed = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cres.Status = cmCTestTestHandler::COMPLETED;
|
||||
|
@ -754,7 +762,7 @@ void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it,
|
|||
else
|
||||
{
|
||||
// Force fail will also be here?
|
||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Failed");
|
||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Failed " << reason);
|
||||
if ( it->WillFail )
|
||||
{
|
||||
cres.Status = cmCTestTestHandler::COMPLETED;
|
||||
|
@ -1729,7 +1737,9 @@ bool cmCTestTestHandler::SetTestsProperties(
|
|||
for ( crit = lval.begin(); crit != lval.end(); ++ crit )
|
||||
{
|
||||
rtit->ErrorRegularExpressions.push_back(
|
||||
cmsys::RegularExpression(crit->c_str()));
|
||||
std::pair<cmsys::RegularExpression, std::string>(
|
||||
cmsys::RegularExpression(crit->c_str()),
|
||||
std::string(crit->c_str())));
|
||||
}
|
||||
}
|
||||
if ( key == "MEASUREMENT" )
|
||||
|
@ -1754,7 +1764,9 @@ bool cmCTestTestHandler::SetTestsProperties(
|
|||
for ( crit = lval.begin(); crit != lval.end(); ++ crit )
|
||||
{
|
||||
rtit->RequiredRegularExpressions.push_back(
|
||||
cmsys::RegularExpression(crit->c_str()));
|
||||
std::pair<cmsys::RegularExpression, std::string>(
|
||||
cmsys::RegularExpression(crit->c_str()),
|
||||
std::string(crit->c_str())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,8 +80,8 @@ public:
|
|||
cmStdString Name;
|
||||
cmStdString Directory;
|
||||
std::vector<std::string> Args;
|
||||
std::vector<cmsys::RegularExpression> ErrorRegularExpressions;
|
||||
std::vector<cmsys::RegularExpression> RequiredRegularExpressions;
|
||||
std::vector<std::pair<cmsys::RegularExpression,std::string> > ErrorRegularExpressions;
|
||||
std::vector<std::pair<cmsys::RegularExpression,std::string> > RequiredRegularExpressions;
|
||||
std::map<cmStdString, cmStdString> Measurements;
|
||||
bool IsInBasedOnREOptions;
|
||||
bool WillFail;
|
||||
|
|
|
@ -950,7 +950,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
|
|||
# We expect test to fail
|
||||
SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES WILL_FAIL ON)
|
||||
GET_TEST_PROPERTY(kwsys.testFail WILL_FAIL wfv)
|
||||
SET_TESTS_PROPERTIES(kwsys.testRegistry PROPERTIES FAIL_REGULAR_EXPRESSION "ERROR;FAIL;Test failed")
|
||||
SET_TESTS_PROPERTIES(kwsys.testRegistry PROPERTIES FAIL_REGULAR_EXPRESSION "ERROR_NOT_VALGRIND;FAIL;Test failed")
|
||||
SET_TESTS_PROPERTIES(kwsys.testRegistry PROPERTIES PASS_REGULAR_EXPRESSION "Test passed")
|
||||
SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES MEASUREMENT "Some Key=Some Value")
|
||||
MESSAGE(STATUS "GET_TEST_PROPERTY returned: ${wfv}")
|
||||
|
|
|
@ -640,7 +640,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
|
|||
CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest3/test.cmake.in"
|
||||
"${CMake_BINARY_DIR}/Tests/CTestTest3/test.cmake" @ONLY ESCAPE_QUOTES)
|
||||
ADD_TEST(CTestTest3 ${CMAKE_CTEST_COMMAND}
|
||||
-S "${CMake_BINARY_DIR}/Tests/CTestTest3/test.cmake" -V
|
||||
-S "${CMake_BINARY_DIR}/Tests/CTestTest3/test.cmake" -VV
|
||||
--output-log "${CMake_BINARY_DIR}/Tests/CTestTest3/testOutput.log"
|
||||
)
|
||||
# these tests take a long time, make sure they have it
|
||||
|
|
Loading…
Reference in New Issue