ENH: Better reporting of what tests failed and write a file with failed tests

This commit is contained in:
Andy Cedilnik 2004-04-16 13:36:36 -04:00
parent 62bd5b7c8c
commit 4c9c3ac84f
1 changed files with 16 additions and 4 deletions

View File

@ -2397,12 +2397,24 @@ int cmCTest::TestDirectory(bool memcheck)
if (failed.size())
{
std::ofstream ofs;
std::cerr << "\nThe following tests FAILED:\n";
for(cmCTest::tm_VectorOfStrings::iterator j = failed.begin();
j != failed.end(); ++j)
{
std::cerr << "\t" << *j << "\n";
this->OpenOutputFile("Temporary", "LastTestsFailed.log", ofs);
std::cerr << "\nThe following tests FAILED:\n";
std::vector<cmCTest::cmCTestTestResult>::iterator ftit;
for(ftit = m_TestResults.begin();
ftit != m_TestResults.end(); ++ftit)
{
if ( ftit->m_Status != cmCTest::COMPLETED )
{
ofs << ftit->m_TestCount << ":" << ftit->m_Name << std::endl;
fprintf(stderr, "\t%3d - %s (%s)\n", ftit->m_TestCount, ftit->m_Name.c_str(),
this->GetTestStatus(ftit->m_Status));
}
}
}
}