ENH: Fix verbose output, fix error message, and fix the exit code check

This commit is contained in:
Andy Cedilnik 2003-08-14 13:34:13 -04:00
parent 86947e0b26
commit 3bbe95397a

View File

@ -1750,7 +1750,7 @@ void cmCTest::ProcessDirectory(std::vector<std::string> &passed,
if ( !m_ShowOnly ) if ( !m_ShowOnly )
{ {
if (res == cmsysProcess_State_Exited && retVal ) if (res == cmsysProcess_State_Exited && retVal == 0)
{ {
fprintf(stderr," Passed\n"); fprintf(stderr," Passed\n");
passed.push_back(args[0].Value); passed.push_back(args[0].Value);
@ -1772,15 +1772,15 @@ void cmCTest::ProcessDirectory(std::vector<std::string> &passed,
cres.m_Status = cmCTest::SEGFAULT; cres.m_Status = cmCTest::SEGFAULT;
break; break;
case cmsysProcess_Exception_Illegal: case cmsysProcess_Exception_Illegal:
fprintf(stderr,"SegFault"); fprintf(stderr,"Illegal");
cres.m_Status = cmCTest::ILLEGAL; cres.m_Status = cmCTest::ILLEGAL;
break; break;
case cmsysProcess_Exception_Interrupt: case cmsysProcess_Exception_Interrupt:
fprintf(stderr,"SegFault"); fprintf(stderr,"Interrupt");
cres.m_Status = cmCTest::INTERRUPT; cres.m_Status = cmCTest::INTERRUPT;
break; break;
case cmsysProcess_Exception_Numerical: case cmsysProcess_Exception_Numerical:
fprintf(stderr,"SegFault"); fprintf(stderr,"Numerical");
cres.m_Status = cmCTest::NUMERICAL; cres.m_Status = cmCTest::NUMERICAL;
break; break;
default: default:
@ -2324,21 +2324,25 @@ bool cmCTest::RunMakeCommand(const char* command, std::string* output,
if ( output ) if ( output )
{ {
output->append(data, length); output->append(data, length);
while ( output->size() > (tick * tick_len) ) if ( !verbose )
{ {
tick ++; while ( output->size() > (tick * tick_len) )
std::cout << "." << std::flush;
if ( tick % tick_line_len == 0 && tick > 0 )
{ {
std::cout << " Size: "; tick ++;
std::cout << int((output->size() / 1024.0) + 1) << "K" << std::endl; std::cout << "." << std::flush;
std::cout << " " << std::flush; if ( tick % tick_line_len == 0 && tick > 0 )
{
std::cout << " Size: ";
std::cout << int((output->size() / 1024.0) + 1) << "K" << std::endl;
std::cout << " " << std::flush;
}
} }
} }
} }
if(verbose) if(verbose)
{ {
std::cout.write(data, length); std::cout.write(data, length);
std::cout.flush();
} }
if ( ofs ) if ( ofs )
{ {
@ -2417,6 +2421,11 @@ int cmCTest::RunTest( const char* command, std::string* output, int *retVal)
{ {
output->append(data, length); output->append(data, length);
} }
if ( m_Verbose )
{
std::cout.write(data, length);
std::cout.flush();
}
} }
cmsysProcess_WaitForExit(cp, 0); cmsysProcess_WaitForExit(cp, 0);