ENH: Better output and use RunMakeCommand for configure
This commit is contained in:
parent
8149dbed29
commit
5a19bd679e
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include <cmsys/RegularExpression.hxx>
|
#include <cmsys/RegularExpression.hxx>
|
||||||
#include <cmsys/Process.h>
|
#include <cmsys/Process.h>
|
||||||
|
#include <cmsys/Base64.h>
|
||||||
|
|
||||||
#include <stdlib.h> // required for atoi
|
#include <stdlib.h> // required for atoi
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -871,13 +872,14 @@ int cmCTest::ConfigureDirectory()
|
|||||||
}
|
}
|
||||||
std::string start_time = ::CurrentTime();
|
std::string start_time = ::CurrentTime();
|
||||||
|
|
||||||
res = cmSystemTools::RunSingleCommand(cCommand.c_str(), &output,
|
|
||||||
&retVal, buildDirectory.c_str(),
|
|
||||||
m_Verbose, m_TimeOut);
|
|
||||||
std::ofstream ofs;
|
std::ofstream ofs;
|
||||||
if ( this->OpenOutputFile("Temporary", "LastConfigure.log", ofs) )
|
this->OpenOutputFile("Temporary", "LastConfigure.log", ofs);
|
||||||
|
res = this->RunMakeCommand(cCommand.c_str(), &output,
|
||||||
|
&retVal, buildDirectory.c_str(),
|
||||||
|
m_Verbose, m_TimeOut, ofs);
|
||||||
|
|
||||||
|
if ( ofs )
|
||||||
{
|
{
|
||||||
ofs << output;
|
|
||||||
ofs.close();
|
ofs.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1034,6 +1036,9 @@ int cmCTest::BuildDirectory()
|
|||||||
}
|
}
|
||||||
std::vector<cmCTestBuildErrorWarning> errorsWarnings;
|
std::vector<cmCTestBuildErrorWarning> errorsWarnings;
|
||||||
|
|
||||||
|
int errors = 0;
|
||||||
|
int warnings = 0;
|
||||||
|
|
||||||
std::vector<int>::size_type kk;
|
std::vector<int>::size_type kk;
|
||||||
cmCTestBuildErrorWarning errorwarning;
|
cmCTestBuildErrorWarning errorwarning;
|
||||||
for ( kk =0; kk < markedLines.size(); kk ++ )
|
for ( kk =0; kk < markedLines.size(); kk ++ )
|
||||||
@ -1078,9 +1083,20 @@ int cmCTest::BuildDirectory()
|
|||||||
errorwarning.m_PostContext += lines[jj] + "\n";
|
errorwarning.m_PostContext += lines[jj] + "\n";
|
||||||
}
|
}
|
||||||
errorsWarnings.push_back(errorwarning);
|
errorsWarnings.push_back(errorwarning);
|
||||||
|
if ( errorwarning.m_Error )
|
||||||
|
{
|
||||||
|
errors ++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
warnings ++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::cout << " " << errors << " Compiler errors" << std::endl;
|
||||||
|
std::cout << " " << warnings << " Compiler warnings" << std::endl;
|
||||||
|
|
||||||
if( !this->OpenOutputFile(m_CurrentTag, "Build.xml", ofs) )
|
if( !this->OpenOutputFile(m_CurrentTag, "Build.xml", ofs) )
|
||||||
{
|
{
|
||||||
std::cerr << "Cannot create build XML file" << std::endl;
|
std::cerr << "Cannot create build XML file" << std::endl;
|
||||||
@ -2132,12 +2148,13 @@ bool cmCTest::RunMakeCommand(const char* command, std::string* output,
|
|||||||
|
|
||||||
std::string::size_type tick = 0;
|
std::string::size_type tick = 0;
|
||||||
std::string::size_type tick_len = 1024;
|
std::string::size_type tick_len = 1024;
|
||||||
|
std::string::size_type tick_line_len = 50;
|
||||||
|
|
||||||
char* data;
|
char* data;
|
||||||
int length;
|
int length;
|
||||||
if ( !verbose )
|
if ( !verbose )
|
||||||
{
|
{
|
||||||
std::cout << " Each . represents 1024 bytes of output" << std::endl;
|
std::cout << " Each . represents " << tick_len << " bytes of output" << std::endl;
|
||||||
std::cout << " " << std::flush;
|
std::cout << " " << std::flush;
|
||||||
}
|
}
|
||||||
while(cmsysProcess_WaitForData(cp, (cmsysProcess_Pipe_STDOUT |
|
while(cmsysProcess_WaitForData(cp, (cmsysProcess_Pipe_STDOUT |
|
||||||
@ -2151,6 +2168,12 @@ bool cmCTest::RunMakeCommand(const char* command, std::string* output,
|
|||||||
{
|
{
|
||||||
tick ++;
|
tick ++;
|
||||||
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)
|
||||||
@ -2164,8 +2187,7 @@ bool cmCTest::RunMakeCommand(const char* command, std::string* output,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::cout << " Size of output: ";
|
std::cout << " Size of output: ";
|
||||||
std::cout.precision(2);
|
std::cout << int(output->size() / 1024.0) << "K" << std::endl;
|
||||||
std::cout << (output->size() / 1024.0) << "K" << std::endl;
|
|
||||||
|
|
||||||
cmsysProcess_WaitForExit(cp, 0);
|
cmsysProcess_WaitForExit(cp, 0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user