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
1 changed files with 20 additions and 11 deletions

View File

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