From 0d824e1d1ad2166a47c27094990cd944dd664f6a Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Tue, 20 Sep 2005 15:08:41 -0400 Subject: [PATCH] ENH: Properly report failed tests --- Source/CTest/cmCTestTestHandler.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 864be5533..bede089b4 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -748,10 +748,10 @@ void cmCTestTestHandler::ProcessDirectory(std::vector &passed, if ( !m_CTest->GetShowOnly() ) { + bool testFailed = false; if (res == cmsysProcess_State_Exited && retVal == 0) { cmCTestLog(m_CTest, HANDLER_OUTPUT, " Passed"); - passed.push_back(testname); if ( it->m_WillFail ) { cmCTestLog(m_CTest, HANDLER_OUTPUT, " - But it should fail!"); @@ -765,6 +765,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector &passed, } else { + testFailed = true; cres.m_Status = cmCTestTestHandler::FAILED; if ( res == cmsysProcess_State_Expired ) { @@ -810,11 +811,19 @@ void cmCTestTestHandler::ProcessDirectory(std::vector &passed, { cres.m_Status = cmCTestTestHandler::COMPLETED; cmCTestLog(m_CTest, HANDLER_OUTPUT, " - supposed to fail"); + testFailed = false; } cmCTestLog(m_CTest, HANDLER_OUTPUT, std::endl); } + } + if ( testFailed ) + { failed.push_back(testname); } + else + { + passed.push_back(testname); + } if (!output.empty() && output.find("