STYLE: Fix some style issues
This commit is contained in:
parent
cb95c0a5bc
commit
26e1fea95b
@ -9,8 +9,8 @@
|
||||
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
||||
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
||||
|
||||
This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
PURPOSE. See the above copyright notices for more information.
|
||||
|
||||
=========================================================================*/
|
||||
@ -42,7 +42,7 @@
|
||||
#include <cmsys/RegularExpression.hxx>
|
||||
#include <cmsys/Process.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
#define DEBUGERR std::cerr << __LINE__ << " "; std::cerr
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
struct tm* cmCTest::GetNightlyTime(std::string str,
|
||||
struct tm* cmCTest::GetNightlyTime(std::string str,
|
||||
bool tomorrowtag)
|
||||
{
|
||||
struct tm* lctime;
|
||||
@ -81,7 +81,8 @@ struct tm* cmCTest::GetNightlyTime(std::string str,
|
||||
// time of the current open dashboard
|
||||
ntime -= dayLength;
|
||||
cmCTestLog(this, DEBUG, "Pick yesterday" << std::endl);
|
||||
cmCTestLog(this, DEBUG, " Future time, subtract day: " << ntime << std::endl);
|
||||
cmCTestLog(this, DEBUG, " Future time, subtract day: " << ntime
|
||||
<< std::endl);
|
||||
}
|
||||
while ( tctime > (ntime + dayLength) )
|
||||
{
|
||||
@ -145,7 +146,8 @@ std::string cmCTest::MakeXMLSafe(const std::string& str)
|
||||
for ( ;*pos; ++pos)
|
||||
{
|
||||
char ch = *pos;
|
||||
if ( (ch > 126 || ch < 32) && ch != 9 && ch != 10 && ch != 13 && ch != '\r' )
|
||||
if ( (ch > 126 || ch < 32) && ch != 9 &&
|
||||
ch != 10 && ch != 13 && ch != '\r' )
|
||||
{
|
||||
char buffer[33];
|
||||
sprintf(buffer, "<%d>", (int)ch);
|
||||
@ -198,7 +200,7 @@ std::string cmCTest::MakeURLSafe(const std::string& str)
|
||||
ch == '&' ||
|
||||
ch == '%' ||
|
||||
ch == '+' ||
|
||||
ch == '=' ||
|
||||
ch == '=' ||
|
||||
ch == '@'
|
||||
) && ch != 9 )
|
||||
{
|
||||
@ -214,8 +216,8 @@ std::string cmCTest::MakeURLSafe(const std::string& str)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
cmCTest::cmCTest()
|
||||
{
|
||||
cmCTest::cmCTest()
|
||||
{
|
||||
m_SubmitIndex = 0;
|
||||
m_ForceNewCTestProcess = false;
|
||||
m_TomorrowTag = false;
|
||||
@ -237,7 +239,7 @@ cmCTest::cmCTest()
|
||||
m_SuppressUpdatingCTestConfiguration = false;
|
||||
m_DartVersion = 1;
|
||||
|
||||
int cc;
|
||||
int cc;
|
||||
for ( cc=0; cc < cmCTest::LAST_TEST; cc ++ )
|
||||
{
|
||||
m_Tests[cc] = 0;
|
||||
@ -265,8 +267,8 @@ cmCTest::cmCTest()
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
cmCTest::~cmCTest()
|
||||
{
|
||||
cmCTest::~cmCTest()
|
||||
{
|
||||
cmCTest::t_TestingHandlers::iterator it;
|
||||
for ( it = m_TestingHandlers.begin(); it != m_TestingHandlers.end(); ++ it )
|
||||
{
|
||||
@ -277,14 +279,15 @@ cmCTest::~cmCTest()
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
int cmCTest::Initialize(const char* binary_dir, bool new_tag, bool verbose_tag)
|
||||
int cmCTest::Initialize(const char* binary_dir, bool new_tag,
|
||||
bool verbose_tag)
|
||||
{
|
||||
cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
|
||||
if(!m_InteractiveDebugMode)
|
||||
{
|
||||
this->BlockTestErrorDiagnostics();
|
||||
}
|
||||
|
||||
|
||||
m_BinaryDir = binary_dir;
|
||||
cmSystemTools::ConvertToUnixSlashes(m_BinaryDir);
|
||||
|
||||
@ -296,8 +299,8 @@ int cmCTest::Initialize(const char* binary_dir, bool new_tag, bool verbose_tag)
|
||||
cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
|
||||
cmCTestLog(this, OUTPUT,
|
||||
" Site: " << this->GetCTestConfiguration("Site") << std::endl
|
||||
<< " Build name: " << this->GetCTestConfiguration("BuildName") << std::endl
|
||||
);
|
||||
<< " Build name: " << this->GetCTestConfiguration("BuildName")
|
||||
<< std::endl);
|
||||
cmCTestLog(this, DEBUG, "Produce XML is on" << std::endl);
|
||||
if ( this->GetCTestConfiguration("NightlyStartTime").empty() )
|
||||
{
|
||||
@ -309,7 +312,8 @@ int cmCTest::Initialize(const char* binary_dir, bool new_tag, bool verbose_tag)
|
||||
|
||||
if ( !this->ReadCustomConfigurationFileTree(m_BinaryDir.c_str()) )
|
||||
{
|
||||
cmCTestLog(this, DEBUG, "Cannot find custom configuration file tree" << std::endl);
|
||||
cmCTestLog(this, DEBUG, "Cannot find custom configuration file tree"
|
||||
<< std::endl);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -320,8 +324,8 @@ int cmCTest::Initialize(const char* binary_dir, bool new_tag, bool verbose_tag)
|
||||
{
|
||||
if ( !cmSystemTools::FileIsDirectory(testingDir.c_str()) )
|
||||
{
|
||||
cmCTestLog(this, ERROR_MESSAGE, "File " << testingDir << " is in the place of the testing directory"
|
||||
<< std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE, "File " << testingDir
|
||||
<< " is in the place of the testing directory" << std::endl);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -329,8 +333,8 @@ int cmCTest::Initialize(const char* binary_dir, bool new_tag, bool verbose_tag)
|
||||
{
|
||||
if ( !cmSystemTools::MakeDirectory(testingDir.c_str()) )
|
||||
{
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Cannot create directory " << testingDir
|
||||
<< std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Cannot create directory "
|
||||
<< testingDir << std::endl);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -361,20 +365,24 @@ int cmCTest::Initialize(const char* binary_dir, bool new_tag, bool verbose_tag)
|
||||
std::string tagmode;
|
||||
if ( cmSystemTools::GetLineFromStream(tfin, tagmode) )
|
||||
{
|
||||
if ( tagmode.size() > 4 && !( m_Tests[cmCTest::START_TEST] || m_Tests[ALL_TEST] ))
|
||||
if ( tagmode.size() > 4 && !( m_Tests[cmCTest::START_TEST] ||
|
||||
m_Tests[ALL_TEST] ))
|
||||
{
|
||||
m_TestModel = cmCTest::GetTestModelFromString(tagmode.c_str());
|
||||
}
|
||||
}
|
||||
tfin.close();
|
||||
}
|
||||
if ( tag.size() == 0 || new_tag || m_Tests[cmCTest::START_TEST] || m_Tests[ALL_TEST])
|
||||
if ( tag.size() == 0 || new_tag || m_Tests[cmCTest::START_TEST] ||
|
||||
m_Tests[ALL_TEST])
|
||||
{
|
||||
cmCTestLog(this, DEBUG, "TestModel: " << this->GetTestModelString() << std::endl);
|
||||
cmCTestLog(this, DEBUG, "TestModel: " << this->GetTestModelString()
|
||||
<< std::endl);
|
||||
cmCTestLog(this, DEBUG, "TestModel: " << m_TestModel << std::endl);
|
||||
if ( m_TestModel == cmCTest::NIGHTLY )
|
||||
{
|
||||
lctime = this->GetNightlyTime(this->GetCTestConfiguration("NightlyStartTime"), m_TomorrowTag);
|
||||
lctime = this->GetNightlyTime(
|
||||
this->GetCTestConfiguration("NightlyStartTime"), m_TomorrowTag);
|
||||
}
|
||||
char datestring[100];
|
||||
sprintf(datestring, "%04d%02d%02d-%02d%02d",
|
||||
@ -393,7 +401,7 @@ int cmCTest::Initialize(const char* binary_dir, bool new_tag, bool verbose_tag)
|
||||
ofs.close();
|
||||
if ( verbose_tag )
|
||||
{
|
||||
cmCTestLog(this, OUTPUT, "Create new tag: " << tag << " - "
|
||||
cmCTestLog(this, OUTPUT, "Create new tag: " << tag << " - "
|
||||
<< this->GetTestModelString() << std::endl);
|
||||
}
|
||||
}
|
||||
@ -410,7 +418,8 @@ bool cmCTest::InitializeFromCommand(cmCTestCommand* command, bool first)
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string src_dir = this->GetCTestConfiguration("SourceDirectory").c_str();
|
||||
std::string src_dir
|
||||
= this->GetCTestConfiguration("SourceDirectory").c_str();
|
||||
std::string bld_dir = this->GetCTestConfiguration("BuildDirectory").c_str();
|
||||
m_DartVersion = 1;
|
||||
m_SubmitFiles.clear();
|
||||
@ -421,8 +430,9 @@ bool cmCTest::InitializeFromCommand(cmCTestCommand* command, bool first)
|
||||
cmSystemTools::ConvertToUnixSlashes(fname);
|
||||
if ( cmSystemTools::FileExists(fname.c_str()) )
|
||||
{
|
||||
cmCTestLog(this, OUTPUT, " Reading ctest configuration file: " << fname.c_str() << std::endl);
|
||||
bool readit = mf->ReadListFile(mf->GetCurrentListFile(),
|
||||
cmCTestLog(this, OUTPUT, " Reading ctest configuration file: "
|
||||
<< fname.c_str() << std::endl);
|
||||
bool readit = mf->ReadListFile(mf->GetCurrentListFile(),
|
||||
fname.c_str() );
|
||||
if(!readit)
|
||||
{
|
||||
@ -434,24 +444,30 @@ bool cmCTest::InitializeFromCommand(cmCTestCommand* command, bool first)
|
||||
}
|
||||
else if ( !first )
|
||||
{
|
||||
cmCTestLog(this, WARNING, "Cannot locate CTest configuration: " << fname.c_str() << std::endl);
|
||||
cmCTestLog(this, WARNING, "Cannot locate CTest configuration: "
|
||||
<< fname.c_str() << std::endl);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmCTestLog(this, HANDLER_OUTPUT, " Cannot locate CTest configuration: " << fname.c_str() << std::endl
|
||||
cmCTestLog(this, HANDLER_OUTPUT, " Cannot locate CTest configuration: "
|
||||
<< fname.c_str() << std::endl
|
||||
<< " Delay the initialization of CTest" << std::endl);
|
||||
}
|
||||
|
||||
this->SetCTestConfigurationFromCMakeVariable(mf, "NightlyStartTime", "CTEST_NIGHTLY_START_TIME");
|
||||
this->SetCTestConfigurationFromCMakeVariable(mf, "NightlyStartTime",
|
||||
"CTEST_NIGHTLY_START_TIME");
|
||||
this->SetCTestConfigurationFromCMakeVariable(mf, "Site", "CTEST_SITE");
|
||||
this->SetCTestConfigurationFromCMakeVariable(mf, "BuildName", "CTEST_BUILD_NAME");
|
||||
this->SetCTestConfigurationFromCMakeVariable(mf, "BuildName",
|
||||
"CTEST_BUILD_NAME");
|
||||
const char* dartVersion = mf->GetDefinition("CTEST_DART_SERVER_VERSION");
|
||||
if ( dartVersion )
|
||||
{
|
||||
m_DartVersion = atoi(dartVersion);
|
||||
if ( m_DartVersion < 0 )
|
||||
{
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Invalid Dart server version: " << dartVersion << ". Please specify the version number." << std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Invalid Dart server version: "
|
||||
<< dartVersion << ". Please specify the version number."
|
||||
<< std::endl);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -464,7 +480,8 @@ bool cmCTest::InitializeFromCommand(cmCTestCommand* command, bool first)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
cmCTestLog(this, OUTPUT, " Use " << this->GetTestModelString() << " tag: " << this->GetCurrentTag() << std::endl);
|
||||
cmCTestLog(this, OUTPUT, " Use " << this->GetTestModelString()
|
||||
<< " tag: " << this->GetCurrentTag() << std::endl);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -490,7 +507,8 @@ bool cmCTest::UpdateCTestConfiguration()
|
||||
// No need to exit if we are not producing XML
|
||||
if ( m_ProduceXML )
|
||||
{
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Cannot find file: " << fileName.c_str() << std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Cannot find file: " << fileName.c_str()
|
||||
<< std::endl);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -532,7 +550,8 @@ bool cmCTest::UpdateCTestConfiguration()
|
||||
continue;
|
||||
}
|
||||
std::string key = line.substr(0, cpos);
|
||||
std::string value = cmCTest::CleanString(line.substr(cpos+1, line.npos));
|
||||
std::string value
|
||||
= cmCTest::CleanString(line.substr(cpos+1, line.npos));
|
||||
m_CTestConfiguration[key] = value;
|
||||
}
|
||||
fin.close();
|
||||
@ -540,7 +559,8 @@ bool cmCTest::UpdateCTestConfiguration()
|
||||
m_TimeOut = atoi(this->GetCTestConfiguration("TimeOut").c_str());
|
||||
if ( m_ProduceXML )
|
||||
{
|
||||
m_CompressXMLFiles = cmSystemTools::IsOn(this->GetCTestConfiguration("CompressSubmission").c_str());
|
||||
m_CompressXMLFiles = cmSystemTools::IsOn(
|
||||
this->GetCTestConfiguration("CompressSubmission").c_str());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -551,7 +571,7 @@ void cmCTest::BlockTestErrorDiagnostics()
|
||||
cmSystemTools::PutEnv("DART_TEST_FROM_DART=1");
|
||||
cmSystemTools::PutEnv("DASHBOARD_TEST_FROM_CTEST=" CMake_VERSION);
|
||||
#if defined(_WIN32)
|
||||
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
|
||||
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -609,7 +629,8 @@ bool cmCTest::SetTest(const char* ttype, bool report)
|
||||
{
|
||||
if ( report )
|
||||
{
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Don't know about test \"" << ttype << "\" yet..." << std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Don't know about test \"" << ttype
|
||||
<< "\" yet..." << std::endl);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -622,7 +643,7 @@ void cmCTest::Finalize()
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool cmCTest::OpenOutputFile(const std::string& path,
|
||||
bool cmCTest::OpenOutputFile(const std::string& path,
|
||||
const std::string& name, cmGeneratedFileStream& stream,
|
||||
bool compress)
|
||||
{
|
||||
@ -635,7 +656,7 @@ bool cmCTest::OpenOutputFile(const std::string& path,
|
||||
{
|
||||
if ( !cmSystemTools::FileIsDirectory(testingDir.c_str()) )
|
||||
{
|
||||
cmCTestLog(this, ERROR_MESSAGE, "File " << testingDir
|
||||
cmCTestLog(this, ERROR_MESSAGE, "File " << testingDir
|
||||
<< " is in the place of the testing directory"
|
||||
<< std::endl);
|
||||
return false;
|
||||
@ -654,7 +675,8 @@ bool cmCTest::OpenOutputFile(const std::string& path,
|
||||
stream.Open(filename.c_str());
|
||||
if( !stream )
|
||||
{
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Problem opening file: " << filename << std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Problem opening file: " << filename
|
||||
<< std::endl);
|
||||
return false;
|
||||
}
|
||||
if ( compress )
|
||||
@ -730,7 +752,7 @@ int cmCTest::ExecuteHandler(const char* shandler)
|
||||
return -1;
|
||||
}
|
||||
handler->Initialize();
|
||||
return handler->ProcessHandler();
|
||||
return handler->ProcessHandler();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@ -754,8 +776,9 @@ int cmCTest::ProcessTests()
|
||||
if ( m_Tests[UPDATE_TEST] || m_Tests[ALL_TEST] )
|
||||
{
|
||||
cmCTestGenericHandler* uphandler = this->GetHandler("update");
|
||||
uphandler->SetOption("SourceDirectory", this->GetCTestConfiguration("SourceDirectory").c_str());
|
||||
update_count = uphandler->ProcessHandler();
|
||||
uphandler->SetOption("SourceDirectory",
|
||||
this->GetCTestConfiguration("SourceDirectory").c_str());
|
||||
update_count = uphandler->ProcessHandler();
|
||||
if ( update_count < 0 )
|
||||
{
|
||||
res |= cmCTest::UPDATE_ERRORS;
|
||||
@ -847,7 +870,8 @@ int cmCTest::ProcessTests()
|
||||
}
|
||||
if ( res != 0 )
|
||||
{
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Errors while running CTest" << std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Errors while running CTest"
|
||||
<< std::endl);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@ -921,7 +945,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
|
||||
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, " \"" << *ait << "\"");
|
||||
}
|
||||
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, std::endl);
|
||||
|
||||
|
||||
// Now create process object
|
||||
cmsysProcess* cp = cmsysProcess_New();
|
||||
cmsysProcess_SetCommand(cp, &*argv.begin());
|
||||
@ -981,22 +1005,25 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
|
||||
if(result == cmsysProcess_State_Exited)
|
||||
{
|
||||
*retVal = cmsysProcess_GetExitValue(cp);
|
||||
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Command exited with the value: " << *retVal << std::endl);
|
||||
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Command exited with the value: "
|
||||
<< *retVal << std::endl);
|
||||
}
|
||||
else if(result == cmsysProcess_State_Exception)
|
||||
{
|
||||
*retVal = cmsysProcess_GetExitException(cp);
|
||||
cmCTestLog(this, WARNING, "There was an exception: " << *retVal << std::endl);
|
||||
cmCTestLog(this, WARNING, "There was an exception: " << *retVal
|
||||
<< std::endl);
|
||||
}
|
||||
else if(result == cmsysProcess_State_Expired)
|
||||
{
|
||||
cmCTestLog(this, WARNING, "There was a timeout" << std::endl);
|
||||
}
|
||||
}
|
||||
else if(result == cmsysProcess_State_Error)
|
||||
{
|
||||
*output += "\n*** ERROR executing: ";
|
||||
*output += cmsysProcess_GetErrorString(cp);
|
||||
cmCTestLog(this, ERROR_MESSAGE, "There was an error: " << cmsysProcess_GetErrorString(cp) << std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE, "There was an error: "
|
||||
<< cmsysProcess_GetErrorString(cp) << std::endl);
|
||||
}
|
||||
|
||||
cmsysProcess_Delete(cp);
|
||||
@ -1010,11 +1037,11 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
|
||||
//######################################################################
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
int cmCTest::RunTest(std::vector<const char*> argv,
|
||||
int cmCTest::RunTest(std::vector<const char*> argv,
|
||||
std::string* output, int *retVal,
|
||||
std::ostream* log)
|
||||
{
|
||||
if(cmSystemTools::SameFile(argv[0], m_CTestSelf.c_str()) &&
|
||||
if(cmSystemTools::SameFile(argv[0], m_CTestSelf.c_str()) &&
|
||||
!m_ForceNewCTestProcess)
|
||||
{
|
||||
cmCTest inst;
|
||||
@ -1033,15 +1060,16 @@ int cmCTest::RunTest(std::vector<const char*> argv,
|
||||
*log << "* Run internal CTest" << std::endl;
|
||||
}
|
||||
std::string oldpath = cmSystemTools::GetCurrentWorkingDirectory();
|
||||
|
||||
|
||||
*retVal = inst.Run(args, output);
|
||||
if ( *log )
|
||||
{
|
||||
*log << output->c_str();
|
||||
}
|
||||
cmSystemTools::ChangeDirectory(oldpath.c_str());
|
||||
|
||||
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Internal cmCTest object used to run test." << std::endl
|
||||
|
||||
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
|
||||
"Internal cmCTest object used to run test." << std::endl
|
||||
<< *output << std::endl);
|
||||
return cmsysProcess_State_Exited;
|
||||
}
|
||||
@ -1081,7 +1109,8 @@ int cmCTest::RunTest(std::vector<const char*> argv,
|
||||
{
|
||||
output->append(&*tempOutput.begin(), tempOutput.size());
|
||||
}
|
||||
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "-- Process completed" << std::endl);
|
||||
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "-- Process completed"
|
||||
<< std::endl);
|
||||
|
||||
int result = cmsysProcess_GetState(cp);
|
||||
|
||||
@ -1095,14 +1124,16 @@ int cmCTest::RunTest(std::vector<const char*> argv,
|
||||
std::string outerr = "\n*** Exception executing: ";
|
||||
outerr += cmsysProcess_GetExceptionString(cp);
|
||||
*output += outerr;
|
||||
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr.c_str() << std::endl << std::flush);
|
||||
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr.c_str() << std::endl
|
||||
<< std::flush);
|
||||
}
|
||||
else if(result == cmsysProcess_State_Error)
|
||||
{
|
||||
std::string outerr = "\n*** ERROR executing: ";
|
||||
outerr += cmsysProcess_GetErrorString(cp);
|
||||
*output += outerr;
|
||||
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr.c_str() << std::endl << std::flush);
|
||||
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr.c_str() << std::endl
|
||||
<< std::flush);
|
||||
}
|
||||
cmsysProcess_Delete(cp);
|
||||
|
||||
@ -1128,13 +1159,17 @@ void cmCTest::EndXML(std::ostream& ostr)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
int cmCTest::GenerateCTestNotesOutput(std::ostream& os, const cmCTest::tm_VectorOfStrings& files)
|
||||
int cmCTest::GenerateCTestNotesOutput(std::ostream& os,
|
||||
const cmCTest::tm_VectorOfStrings& files)
|
||||
{
|
||||
cmCTest::tm_VectorOfStrings::const_iterator it;
|
||||
os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
<< "<?xml-stylesheet type=\"text/xsl\" href=\"Dart/Source/Server/XSL/Build.xsl <file:///Dart/Source/Server/XSL/Build.xsl> \"?>\n"
|
||||
<< "<Site BuildName=\"" << this->GetCTestConfiguration("BuildName") << "\" BuildStamp=\""
|
||||
<< m_CurrentTag << "-" << this->GetTestModelString() << "\" Name=\""
|
||||
<< "<?xml-stylesheet type=\"text/xsl\" "
|
||||
"href=\"Dart/Source/Server/XSL/Build.xsl "
|
||||
"<file:///Dart/Source/Server/XSL/Build.xsl> \"?>\n"
|
||||
<< "<Site BuildName=\"" << this->GetCTestConfiguration("BuildName")
|
||||
<< "\" BuildStamp=\""
|
||||
<< m_CurrentTag << "-" << this->GetTestModelString() << "\" Name=\""
|
||||
<< this->GetCTestConfiguration("Site") << "\" Generator=\"ctest"
|
||||
<< cmVersion::GetCMakeVersion()
|
||||
<< "\">\n"
|
||||
@ -1160,7 +1195,8 @@ int cmCTest::GenerateCTestNotesOutput(std::ostream& os, const cmCTest::tm_Vector
|
||||
else
|
||||
{
|
||||
os << "Problem reading file: " << it->c_str() << std::endl;
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Problem reading file: " << it->c_str() << " while creating notes" << std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Problem reading file: " << it->c_str()
|
||||
<< " while creating notes" << std::endl);
|
||||
}
|
||||
os << "</Text>\n"
|
||||
<< "</Note>" << std::endl;
|
||||
@ -1215,7 +1251,8 @@ bool cmCTest::SubmitExtraFiles(const std::vector<cmStdString> &files)
|
||||
{
|
||||
if ( !cmSystemTools::FileExists(it->c_str()) )
|
||||
{
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Cannot find extra file: " << it->c_str() << " to submit."
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Cannot find extra file: "
|
||||
<< it->c_str() << " to submit."
|
||||
<< std::endl;);
|
||||
return false;
|
||||
}
|
||||
@ -1246,7 +1283,8 @@ bool cmCTest::SubmitExtraFiles(const char* cfiles)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool cmCTest::CheckArgument(const std::string& arg, const char* varg1, const char* varg2)
|
||||
bool cmCTest::CheckArgument(const std::string& arg, const char* varg1,
|
||||
const char* varg2)
|
||||
{
|
||||
if ( varg1 && arg == varg1 || varg2 && arg == varg2 )
|
||||
{
|
||||
@ -1271,7 +1309,8 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
|
||||
this->m_CTestConfigFile= args[i];
|
||||
}
|
||||
|
||||
if(this->CheckArgument(arg, "-C", "--build-config") && i < args.size() - 1)
|
||||
if(this->CheckArgument(arg, "-C", "--build-config") &&
|
||||
i < args.size() - 1)
|
||||
{
|
||||
i++;
|
||||
this->m_ConfigType = args[i];
|
||||
@ -1309,7 +1348,8 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
|
||||
{
|
||||
this->m_RunConfigurationScript = true;
|
||||
i++;
|
||||
cmCTestScriptHandler* ch = static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
|
||||
cmCTestScriptHandler* ch
|
||||
= static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
|
||||
ch->AddConfigurationScript(args[i].c_str());
|
||||
}
|
||||
|
||||
@ -1327,7 +1367,8 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
|
||||
{
|
||||
m_ForceNewCTestProcess = true;
|
||||
}
|
||||
if(this->CheckArgument(arg, "--interactive-debug-mode") && i < args.size() - 1 )
|
||||
if(this->CheckArgument(arg, "--interactive-debug-mode") &&
|
||||
i < args.size() - 1 )
|
||||
{
|
||||
i++;
|
||||
m_InteractiveDebugMode = cmSystemTools::IsOn(args[i].c_str());
|
||||
@ -1417,7 +1458,7 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
|
||||
{
|
||||
this->SetTestModel(cmCTest::CONTINUOUS);
|
||||
this->SetTest("Update");
|
||||
}
|
||||
}
|
||||
else if ( targ == "ContinuousConfigure" )
|
||||
{
|
||||
this->SetTestModel(cmCTest::CONTINUOUS);
|
||||
@ -1525,29 +1566,38 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
|
||||
else
|
||||
{
|
||||
performSomeTest = false;
|
||||
cmCTestLog(this, ERROR_MESSAGE, "CTest -D called with incorrect option: " << targ << std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE,
|
||||
"CTest -D called with incorrect option: " << targ << std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
|
||||
<< " " << ctestExec << " -D Continuous" << std::endl
|
||||
<< " " << ctestExec << " -D Continuous(Start|Update|Configure|Build)" << std::endl
|
||||
<< " " << ctestExec << " -D Continuous(Test|Coverage|MemCheck|Submit)" << std::endl
|
||||
<< " " << ctestExec
|
||||
<< " -D Continuous(Start|Update|Configure|Build)" << std::endl
|
||||
<< " " << ctestExec
|
||||
<< " -D Continuous(Test|Coverage|MemCheck|Submit)" << std::endl
|
||||
<< " " << ctestExec << " -D Experimental" << std::endl
|
||||
<< " " << ctestExec << " -D Experimental(Start|Update|Configure|Build)" << std::endl
|
||||
<< " " << ctestExec << " -D Experimental(Test|Coverage|MemCheck|Submit)" << std::endl
|
||||
<< " " << ctestExec
|
||||
<< " -D Experimental(Start|Update|Configure|Build)" << std::endl
|
||||
<< " " << ctestExec
|
||||
<< " -D Experimental(Test|Coverage|MemCheck|Submit)" << std::endl
|
||||
<< " " << ctestExec << " -D Nightly" << std::endl
|
||||
<< " " << ctestExec << " -D Nightly(Start|Update|Configure|Build)" << std::endl
|
||||
<< " " << ctestExec << " -D Nightly(Test|Coverage|MemCheck|Submit)" << std::endl
|
||||
<< " " << ctestExec
|
||||
<< " -D Nightly(Start|Update|Configure|Build)" << std::endl
|
||||
<< " " << ctestExec
|
||||
<< " -D Nightly(Test|Coverage|MemCheck|Submit)" << std::endl
|
||||
<< " " << ctestExec << " -D NightlyMemoryCheck" << std::endl);
|
||||
}
|
||||
}
|
||||
|
||||
if(this->CheckArgument(arg, "-T", "--test-action") && (i < args.size() -1) )
|
||||
if(this->CheckArgument(arg, "-T", "--test-action") &&
|
||||
(i < args.size() -1) )
|
||||
{
|
||||
this->m_ProduceXML = true;
|
||||
i++;
|
||||
if ( !this->SetTest(args[i].c_str(), false) )
|
||||
{
|
||||
performSomeTest = false;
|
||||
cmCTestLog(this, ERROR_MESSAGE, "CTest -T called with incorrect option: "
|
||||
cmCTestLog(this, ERROR_MESSAGE,
|
||||
"CTest -T called with incorrect option: "
|
||||
<< args[i].c_str() << std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
|
||||
<< " " << ctestExec << " -T all" << std::endl
|
||||
@ -1563,7 +1613,8 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
|
||||
}
|
||||
}
|
||||
|
||||
if(this->CheckArgument(arg, "-M", "--test-model") && (i < args.size() -1) )
|
||||
if(this->CheckArgument(arg, "-M", "--test-model") &&
|
||||
(i < args.size() -1) )
|
||||
{
|
||||
i++;
|
||||
std::string const& str = args[i];
|
||||
@ -1582,7 +1633,9 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
|
||||
else
|
||||
{
|
||||
performSomeTest = false;
|
||||
cmCTestLog(this, ERROR_MESSAGE, "CTest -M called with incorrect option: " << str.c_str() << std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE,
|
||||
"CTest -M called with incorrect option: " << str.c_str()
|
||||
<< std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
|
||||
<< " " << ctestExec << " -M Continuous" << std::endl
|
||||
<< " " << ctestExec << " -M Experimental" << std::endl
|
||||
@ -1590,25 +1643,30 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
|
||||
}
|
||||
}
|
||||
|
||||
if(this->CheckArgument(arg, "-I", "--tests-information") && i < args.size() - 1)
|
||||
if(this->CheckArgument(arg, "-I", "--tests-information") &&
|
||||
i < args.size() - 1)
|
||||
{
|
||||
i++;
|
||||
this->GetHandler("test")->SetOption("TestsToRunInformation", args[i].c_str());
|
||||
}
|
||||
this->GetHandler("test")->SetOption("TestsToRunInformation",
|
||||
args[i].c_str());
|
||||
}
|
||||
if(this->CheckArgument(arg, "-U", "--union"))
|
||||
{
|
||||
{
|
||||
this->GetHandler("test")->SetOption("UseUnion", "true");
|
||||
}
|
||||
if(this->CheckArgument(arg, "-R", "--tests-regex") && i < args.size() - 1)
|
||||
{
|
||||
i++;
|
||||
this->GetHandler("test")->SetOption("IncludeRegularExpression", args[i].c_str());
|
||||
}
|
||||
|
||||
if(this->CheckArgument(arg, "-E", "--exclude-regex") && i < args.size() - 1)
|
||||
{
|
||||
}
|
||||
if(this->CheckArgument(arg, "-R", "--tests-regex") && i < args.size() - 1)
|
||||
{
|
||||
i++;
|
||||
this->GetHandler("test")->SetOption("ExcludeRegularExpression", args[i].c_str());
|
||||
this->GetHandler("test")->SetOption("IncludeRegularExpression",
|
||||
args[i].c_str());
|
||||
}
|
||||
|
||||
if(this->CheckArgument(arg, "-E", "--exclude-regex") &&
|
||||
i < args.size() - 1)
|
||||
{
|
||||
i++;
|
||||
this->GetHandler("test")->SetOption("ExcludeRegularExpression",
|
||||
args[i].c_str());
|
||||
}
|
||||
|
||||
if(this->CheckArgument(arg, "--overwrite") && i < args.size() - 1)
|
||||
@ -1639,11 +1697,14 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
|
||||
cmakeAndTest = true;
|
||||
}
|
||||
cmCTest::t_TestingHandlers::iterator it;
|
||||
for ( it = m_TestingHandlers.begin(); it != m_TestingHandlers.end(); ++ it )
|
||||
for ( it = m_TestingHandlers.begin();
|
||||
it != m_TestingHandlers.end();
|
||||
++ it )
|
||||
{
|
||||
if ( !it->second->ProcessCommandLineArguments(arg, i, args) )
|
||||
{
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Problem parsing command line arguments within a handler");
|
||||
cmCTestLog(this, ERROR_MESSAGE,
|
||||
"Problem parsing command line arguments within a handler");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -1660,7 +1721,7 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
|
||||
if(cmakeAndTest)
|
||||
{
|
||||
m_Verbose = true;
|
||||
cmCTestBuildAndTestHandler* handler =
|
||||
cmCTestBuildAndTestHandler* handler =
|
||||
static_cast<cmCTestBuildAndTestHandler*>(this->GetHandler("buildtest"));
|
||||
int retv = handler->ProcessHandler();
|
||||
*output = handler->GetOutput();
|
||||
@ -1681,7 +1742,9 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
|
||||
cmCTestLog(this, OUTPUT, "* Extra verbosity turned on" << std::endl);
|
||||
}
|
||||
cmCTest::t_TestingHandlers::iterator it;
|
||||
for ( it = m_TestingHandlers.begin(); it != m_TestingHandlers.end(); ++ it )
|
||||
for ( it = m_TestingHandlers.begin();
|
||||
it != m_TestingHandlers.end();
|
||||
++ it )
|
||||
{
|
||||
it->second->SetVerbose(this->m_ExtraVerbose);
|
||||
it->second->SetSubmitIndex(m_SubmitIndex);
|
||||
@ -1694,17 +1757,21 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
|
||||
m_ExtraVerbose = m_Verbose;
|
||||
m_Verbose = true;
|
||||
cmCTest::t_TestingHandlers::iterator it;
|
||||
for ( it = m_TestingHandlers.begin(); it != m_TestingHandlers.end(); ++ it )
|
||||
for ( it = m_TestingHandlers.begin();
|
||||
it != m_TestingHandlers.end();
|
||||
++ it )
|
||||
{
|
||||
it->second->SetVerbose(this->m_Verbose);
|
||||
it->second->SetSubmitIndex(m_SubmitIndex);
|
||||
}
|
||||
cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
|
||||
if ( !this->Initialize(cmSystemTools::GetCurrentWorkingDirectory().c_str()) )
|
||||
if ( !this->Initialize(
|
||||
cmSystemTools::GetCurrentWorkingDirectory().c_str()) )
|
||||
{
|
||||
cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
|
||||
res = 12;
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Problem initializing the dashboard." << std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Problem initializing the dashboard."
|
||||
<< std::endl);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1817,11 +1884,13 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir)
|
||||
for ( fileIt = files.begin(); fileIt != files.end();
|
||||
++ fileIt )
|
||||
{
|
||||
cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: " << fileIt->c_str() << std::endl);
|
||||
cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: "
|
||||
<< fileIt->c_str() << std::endl);
|
||||
if ( !lg->GetMakefile()->ReadListFile(0, fileIt->c_str()) ||
|
||||
cmSystemTools::GetErrorOccuredFlag() )
|
||||
{
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Problem reading custom configuration: " << fileIt->c_str() << std::endl);
|
||||
cmCTestLog(this, ERROR_MESSAGE, "Problem reading custom configuration: "
|
||||
<< fileIt->c_str() << std::endl);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1830,12 +1899,13 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir)
|
||||
{
|
||||
it->second->PopulateCustomVectors(mf);
|
||||
}
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void cmCTest::PopulateCustomVector(cmMakefile* mf, const char* def, tm_VectorOfStrings& vec)
|
||||
void cmCTest::PopulateCustomVector(cmMakefile* mf, const char* def,
|
||||
tm_VectorOfStrings& vec)
|
||||
{
|
||||
if ( !def)
|
||||
{
|
||||
@ -1874,7 +1944,8 @@ void cmCTest::PopulateCustomInteger(cmMakefile* mf, const char* def, int& val)
|
||||
//----------------------------------------------------------------------
|
||||
std::string cmCTest::GetShortPathToFile(const char* cfname)
|
||||
{
|
||||
const std::string& sourceDir = this->GetCTestConfiguration("SourceDirectory");
|
||||
const std::string& sourceDir
|
||||
= this->GetCTestConfiguration("SourceDirectory");
|
||||
const std::string& buildDir = this->GetCTestConfiguration("BuildDirectory");
|
||||
std::string fname = cmSystemTools::CollapseFullPath(cfname);
|
||||
|
||||
@ -1928,7 +1999,8 @@ std::string cmCTest::GetShortPathToFile(const char* cfname)
|
||||
//----------------------------------------------------------------------
|
||||
std::string cmCTest::GetCTestConfiguration(const char *name)
|
||||
{
|
||||
if ( m_CTestConfigurationOverwrites.find(name) != m_CTestConfigurationOverwrites.end() )
|
||||
if ( m_CTestConfigurationOverwrites.find(name) !=
|
||||
m_CTestConfigurationOverwrites.end() )
|
||||
{
|
||||
return m_CTestConfigurationOverwrites[name];
|
||||
}
|
||||
@ -1956,7 +2028,7 @@ void cmCTest::SetCTestConfiguration(const char *name, const char* value)
|
||||
m_CTestConfiguration[name] = value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
std::string cmCTest::GetCurrentTag()
|
||||
{
|
||||
@ -2007,7 +2079,8 @@ void cmCTest::AddCTestConfigurationOverwrite(const char* encstr)
|
||||
if ( epos == overStr.npos )
|
||||
{
|
||||
cmCTestLog(this, ERROR_MESSAGE,
|
||||
"CTest configuration overwrite specified in the wrong format." << std::endl
|
||||
"CTest configuration overwrite specified in the wrong format."
|
||||
<< std::endl
|
||||
<< "Valid format is: --overwrite key=value" << std::endl
|
||||
<< "The specified was: --overwrite " << overStr.c_str() << std::endl);
|
||||
return;
|
||||
@ -2018,7 +2091,8 @@ void cmCTest::AddCTestConfigurationOverwrite(const char* encstr)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf, const char* dconfig, const char* cmake_var)
|
||||
bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf,
|
||||
const char* dconfig, const char* cmake_var)
|
||||
{
|
||||
const char* ctvar;
|
||||
ctvar = mf->GetDefinition(cmake_var);
|
||||
@ -2031,10 +2105,10 @@ bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf, const char*
|
||||
}
|
||||
|
||||
bool cmCTest::RunCommand(
|
||||
const char* command,
|
||||
const char* command,
|
||||
std::string* stdOut,
|
||||
std::string* stdErr,
|
||||
int *retVal,
|
||||
int *retVal,
|
||||
const char* dir,
|
||||
double timeout)
|
||||
{
|
||||
@ -2044,7 +2118,7 @@ bool cmCTest::RunCommand(
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
std::vector<const char*> argv;
|
||||
for(std::vector<cmStdString>::const_iterator a = args.begin();
|
||||
a != args.end(); ++a)
|
||||
@ -2065,7 +2139,7 @@ bool cmCTest::RunCommand(
|
||||
}
|
||||
cmsysProcess_SetTimeout(cp, timeout);
|
||||
cmsysProcess_Execute(cp);
|
||||
|
||||
|
||||
std::vector<char> tempOutput;
|
||||
std::vector<char> tempError;
|
||||
char* data;
|
||||
@ -2086,16 +2160,17 @@ bool cmCTest::RunCommand(
|
||||
default:
|
||||
done = true;
|
||||
}
|
||||
if ( (res == cmsysProcess_Pipe_STDOUT || res == cmsysProcess_Pipe_STDERR) && m_ExtraVerbose )
|
||||
if ( (res == cmsysProcess_Pipe_STDOUT ||
|
||||
res == cmsysProcess_Pipe_STDERR) && m_ExtraVerbose )
|
||||
{
|
||||
cmSystemTools::Stdout(data, length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cmsysProcess_WaitForExit(cp, 0);
|
||||
stdOut->append(&*tempOutput.begin(), tempOutput.size());
|
||||
stdErr->append(&*tempError.begin(), tempError.size());
|
||||
|
||||
|
||||
bool result = true;
|
||||
if(cmsysProcess_GetState(cp) == cmsysProcess_State_Exited)
|
||||
{
|
||||
@ -2132,7 +2207,7 @@ bool cmCTest::RunCommand(
|
||||
stdErr->append(error_str, strlen(error_str));
|
||||
result = false;
|
||||
}
|
||||
|
||||
|
||||
cmsysProcess_Delete(cp);
|
||||
return result;
|
||||
}
|
||||
@ -2152,7 +2227,7 @@ void cmCTest::SetOutputLogFileName(const char* name)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
static const char* cmCTestStringLogType[] =
|
||||
static const char* cmCTestStringLogType[] =
|
||||
{
|
||||
"DEBUG",
|
||||
"OUTPUT",
|
||||
@ -2187,7 +2262,8 @@ void cmCTest::Log(int logType, const char* file, int line, const char* msg)
|
||||
{
|
||||
bool display = true;
|
||||
if ( logType == cmCTest::DEBUG && !m_Debug ) { display = false; }
|
||||
if ( logType == cmCTest::HANDLER_VERBOSE_OUTPUT && !m_Debug && !m_ExtraVerbose ) { display = false; }
|
||||
if ( logType == cmCTest::HANDLER_VERBOSE_OUTPUT && !m_Debug &&
|
||||
!m_ExtraVerbose ) { display = false; }
|
||||
if ( display )
|
||||
{
|
||||
cmCTestLogOutputFileLine(*m_OutputLogFile);
|
||||
|
@ -9,8 +9,8 @@
|
||||
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
||||
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
||||
|
||||
This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
PURPOSE. See the above copyright notices for more information.
|
||||
|
||||
=========================================================================*/
|
||||
@ -32,7 +32,8 @@ class cmCTestCommand;
|
||||
do { \
|
||||
cmOStringStream cmCTestLog_msg; \
|
||||
cmCTestLog_msg << msg; \
|
||||
(ctSelf)->Log(cmCTest::logType, __FILE__, __LINE__, cmCTestLog_msg.str().c_str());\
|
||||
(ctSelf)->Log(cmCTest::logType, __FILE__, __LINE__,\
|
||||
cmCTestLog_msg.str().c_str());\
|
||||
} while ( 0 )
|
||||
|
||||
#ifdef cerr
|
||||
@ -53,11 +54,12 @@ public:
|
||||
|
||||
///! Process Command line arguments
|
||||
int Run(std::vector<std::string>const&, std::string* output = 0);
|
||||
|
||||
|
||||
/**
|
||||
* Initialize and finalize testing
|
||||
*/
|
||||
int Initialize(const char* binary_dir, bool new_tag = false, bool verbose_tag = true);
|
||||
int Initialize(const char* binary_dir, bool new_tag = false,
|
||||
bool verbose_tag = true);
|
||||
bool InitializeFromCommand(cmCTestCommand* command, bool first = false);
|
||||
void Finalize();
|
||||
|
||||
@ -76,14 +78,14 @@ public:
|
||||
/*
|
||||
* A utility function that returns the nightly time
|
||||
*/
|
||||
struct tm* GetNightlyTime(std::string str,
|
||||
struct tm* GetNightlyTime(std::string str,
|
||||
bool tomorrowtag);
|
||||
|
||||
|
||||
/*
|
||||
* Is the tomorrow tag set?
|
||||
*/
|
||||
bool GetTomorrowTag() { return m_TomorrowTag; };
|
||||
|
||||
|
||||
/**
|
||||
* Try to run tests of the project
|
||||
*/
|
||||
@ -93,7 +95,7 @@ public:
|
||||
std::string GetConfigType();
|
||||
double GetTimeOut() { return m_TimeOut; }
|
||||
void SetTimeOut(double t) { m_TimeOut = t; }
|
||||
|
||||
|
||||
/**
|
||||
* Check if CTest file exists
|
||||
*/
|
||||
@ -110,32 +112,33 @@ public:
|
||||
*/
|
||||
void SetTestModel(int mode);
|
||||
int GetTestModel() { return m_TestModel; };
|
||||
|
||||
|
||||
std::string GetTestModelString();
|
||||
static int GetTestModelFromString(const char* str);
|
||||
static std::string CleanString(const std::string& str);
|
||||
std::string GetCTestConfiguration(const char *name);
|
||||
void SetCTestConfiguration(const char *name, const char* value);
|
||||
void EmptyCTestConfiguration();
|
||||
|
||||
|
||||
/**
|
||||
* constructor and destructor
|
||||
*/
|
||||
cmCTest();
|
||||
~cmCTest();
|
||||
|
||||
|
||||
//! Set the notes files to be created.
|
||||
void SetNotesFiles(const char* notes);
|
||||
|
||||
static void PopulateCustomVector(cmMakefile* mf, const char* definition,
|
||||
static void PopulateCustomVector(cmMakefile* mf, const char* definition,
|
||||
tm_VectorOfStrings& vec);
|
||||
static void PopulateCustomInteger(cmMakefile* mf, const char* def, int& val);
|
||||
static void PopulateCustomInteger(cmMakefile* mf, const char* def,
|
||||
int& val);
|
||||
|
||||
///! Get the current time as string
|
||||
std::string CurrentTime();
|
||||
|
||||
|
||||
///! Open file in the output directory and set the stream
|
||||
bool OpenOutputFile(const std::string& path,
|
||||
bool OpenOutputFile(const std::string& path,
|
||||
const std::string& name,
|
||||
cmGeneratedFileStream& stream,
|
||||
bool compress = false);
|
||||
@ -147,7 +150,7 @@ public:
|
||||
bool GetShowOnly();
|
||||
|
||||
/**
|
||||
* Run a single executable command and put the stdout and stderr
|
||||
* Run a single executable command and put the stdout and stderr
|
||||
* in output.
|
||||
*
|
||||
* If verbose is false, no user-viewable output from the program
|
||||
@ -157,19 +160,19 @@ public:
|
||||
* timeout expires. Timeout is specified in seconds.
|
||||
*
|
||||
* Argument retVal should be a pointer to the location where the
|
||||
* exit code will be stored. If the retVal is not specified and
|
||||
* the program exits with a code other than 0, then the this
|
||||
* exit code will be stored. If the retVal is not specified and
|
||||
* the program exits with a code other than 0, then the this
|
||||
* function will return false.
|
||||
*
|
||||
* If the command has spaces in the path the caller MUST call
|
||||
* cmSystemTools::ConvertToRunCommandPath on the command before passing
|
||||
* it into this function or it will not work. The command must be correctly
|
||||
* escaped for this to with spaces.
|
||||
* escaped for this to with spaces.
|
||||
*/
|
||||
bool RunCommand(const char* command,
|
||||
std::string* stdOut, std::string* stdErr,
|
||||
int* retVal = 0, const char* dir = 0, double timeout = 0.0);
|
||||
|
||||
|
||||
//! Start CTest XML output file
|
||||
void StartXML(std::ostream& ostr);
|
||||
|
||||
@ -179,7 +182,7 @@ public:
|
||||
//! Run command specialized for make and configure. Returns process status
|
||||
// and retVal is return value or exception.
|
||||
int RunMakeCommand(const char* command, std::string* output,
|
||||
int* retVal, const char* dir, int timeout,
|
||||
int* retVal, const char* dir, int timeout,
|
||||
std::ofstream& ofs);
|
||||
|
||||
/*
|
||||
@ -189,7 +192,7 @@ public:
|
||||
|
||||
//! Get the path to the build tree
|
||||
std::string GetBinaryDir();
|
||||
|
||||
|
||||
//! Get the short path to the file. This means if the file is in binary or
|
||||
//source directory, it will become /.../relative/path/to/file
|
||||
std::string GetShortPathToFile(const char* fname);
|
||||
@ -221,15 +224,16 @@ public:
|
||||
|
||||
//! Run command specialized for tests. Returns process status and retVal is
|
||||
// return value or exception.
|
||||
int RunTest(std::vector<const char*> args, std::string* output, int *retVal,
|
||||
int RunTest(std::vector<const char*> args, std::string* output, int *retVal,
|
||||
std::ostream* logfile);
|
||||
|
||||
/**
|
||||
* Execute handler and return its result. If the handler fails, it returns negative value.
|
||||
* Execute handler and return its result. If the handler fails, it returns
|
||||
* negative value.
|
||||
*/
|
||||
int ExecuteHandler(const char* handler);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Get the handler object
|
||||
*/
|
||||
cmCTestGenericHandler* GetHandler(const char* handler);
|
||||
@ -238,13 +242,14 @@ public:
|
||||
/*
|
||||
* Set the CTest variable from CMake variable
|
||||
*/
|
||||
bool SetCTestConfigurationFromCMakeVariable(cmMakefile* mf, const char* dconfig, const char* cmake_var);
|
||||
bool SetCTestConfigurationFromCMakeVariable(cmMakefile* mf,
|
||||
const char* dconfig, const char* cmake_var);
|
||||
|
||||
//! Make string safe to be send as an URL
|
||||
static std::string MakeURLSafe(const std::string&);
|
||||
|
||||
//! Should ctect configuration be updated. When using new style ctest script,
|
||||
// this should be true.
|
||||
//! Should ctect configuration be updated. When using new style ctest
|
||||
// script, this should be true.
|
||||
void SetSuppressUpdatingCTestConfiguration(bool val)
|
||||
{
|
||||
m_SuppressUpdatingCTestConfiguration = val;
|
||||
@ -300,7 +305,7 @@ private:
|
||||
// these are helper classes
|
||||
typedef std::map<cmStdString,cmCTestGenericHandler*> t_TestingHandlers;
|
||||
t_TestingHandlers m_TestingHandlers;
|
||||
|
||||
|
||||
bool m_ShowOnly;
|
||||
|
||||
enum {
|
||||
@ -317,7 +322,7 @@ private:
|
||||
ALL_TEST = 10,
|
||||
LAST_TEST = 11
|
||||
};
|
||||
|
||||
|
||||
//! Map of configuration properties
|
||||
typedef std::map<cmStdString, cmStdString> tm_CTestConfigurationMap;
|
||||
|
||||
@ -325,7 +330,7 @@ private:
|
||||
tm_CTestConfigurationMap m_CTestConfiguration;
|
||||
tm_CTestConfigurationMap m_CTestConfigurationOverwrites;
|
||||
int m_Tests[LAST_TEST];
|
||||
|
||||
|
||||
std::string m_CurrentTag;
|
||||
bool m_TomorrowTag;
|
||||
|
||||
@ -341,7 +346,7 @@ private:
|
||||
std::string m_BinaryDir;
|
||||
|
||||
std::string m_NotesFiles;
|
||||
|
||||
|
||||
|
||||
int ReadCustomConfigurationFileTree(const char* dir);
|
||||
|
||||
@ -350,21 +355,23 @@ private:
|
||||
bool m_ShortDateFormat;
|
||||
|
||||
bool m_CompressXMLFiles;
|
||||
|
||||
|
||||
void BlockTestErrorDiagnostics();
|
||||
|
||||
|
||||
|
||||
//! Reread the configuration file
|
||||
bool UpdateCTestConfiguration();
|
||||
|
||||
//! Create not from files.
|
||||
int GenerateCTestNotesOutput(std::ostream& os, const tm_VectorOfStrings& files);
|
||||
int GenerateCTestNotesOutput(std::ostream& os,
|
||||
const tm_VectorOfStrings& files);
|
||||
|
||||
///! Find the running cmake
|
||||
void FindRunningCMake(const char* arg0);
|
||||
|
||||
//! Check if the argument is the one specified
|
||||
bool CheckArgument(const std::string& arg, const char* varg1, const char* varg2 = 0);
|
||||
bool CheckArgument(const std::string& arg, const char* varg1,
|
||||
const char* varg2 = 0);
|
||||
|
||||
bool m_SuppressUpdatingCTestConfiguration;
|
||||
|
||||
@ -377,7 +384,7 @@ private:
|
||||
std::set<cmStdString> m_SubmitFiles;
|
||||
|
||||
int m_SubmitIndex;
|
||||
|
||||
|
||||
cmGeneratedFileStream* m_OutputLogFile;
|
||||
int m_OutputLogFileLastTag;
|
||||
};
|
||||
@ -385,7 +392,8 @@ private:
|
||||
class cmCTestLogWrite
|
||||
{
|
||||
public:
|
||||
cmCTestLogWrite(const char* data, size_t length) : Data(data), Length(length) {}
|
||||
cmCTestLogWrite(const char* data, size_t length)
|
||||
: Data(data), Length(length) {}
|
||||
|
||||
const char* Data;
|
||||
size_t Length;
|
||||
|
@ -9,8 +9,8 @@
|
||||
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
||||
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
||||
|
||||
This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
PURPOSE. See the above copyright notices for more information.
|
||||
|
||||
=========================================================================*/
|
||||
@ -62,45 +62,51 @@ static const cmDocumentationEntry cmDocumentationOptions[] =
|
||||
"Test output is normally suppressed and only summary information is "
|
||||
"displayed. This option will show even more test output."},
|
||||
{"--debug", "Displaying more verbose internals of CTest.",
|
||||
"This feature will result in large number of output that is mostly useful "
|
||||
"for debugging dashboard problems."},
|
||||
"This feature will result in large number of output that is mostly "
|
||||
"useful for debugging dashboard problems."},
|
||||
{"-Q,--quiet", "Make ctest quiet.",
|
||||
"This option will suppress all the output. The output log file will still be "
|
||||
"generated if the --output-log is specified. Options such as --verbose, "
|
||||
"--extra-verbose, and --debug are ignored if --quiet is specified."},
|
||||
"This option will suppress all the output. The output log file will "
|
||||
"still be generated if the --output-log is specified. Options such "
|
||||
"as --verbose, --extra-verbose, and --debug are ignored if --quiet is "
|
||||
"specified."},
|
||||
{"-O <file>, --output-log <file>", "Output to log file",
|
||||
"This option tells ctest to write all its output to a log file."},
|
||||
{"-N,--show-only", "Disable actual execution of tests.",
|
||||
"This option tells ctest to list the tests that would be run but not "
|
||||
"actually run them. Useful in conjunction with the -R and -E options."},
|
||||
{"-R <regex>, --tests-regex <regex>", "Run tests matching regular expression.",
|
||||
{"-R <regex>, --tests-regex <regex>", "Run tests matching regular "
|
||||
"expression.",
|
||||
"This option tells ctest to run only the tests whose names match the "
|
||||
"given regular expression."},
|
||||
{"-E <regex>, --exclude-regex <regex>", "Exclude tests matching regular expression.",
|
||||
{"-E <regex>, --exclude-regex <regex>", "Exclude tests matching regular "
|
||||
"expression.",
|
||||
"This option tells ctest to NOT run the tests whose names match the "
|
||||
"given regular expression."},
|
||||
{"-D <dashboard>, --dashboard <dashboard>", "Execute dashboard test",
|
||||
"This option tells ctest to perform act as a Dart client and perform "
|
||||
"a dashboard test. All tests are <Mode><Test>, where Mode can be Experimental, "
|
||||
"Nightly, and Continuous, and Test can be Start, Update, Configure, "
|
||||
"Build, Test, Coverage, and Submit."},
|
||||
"a dashboard test. All tests are <Mode><Test>, where Mode can be "
|
||||
"Experimental, Nightly, and Continuous, and Test can be Start, Update, "
|
||||
"Configure, Build, Test, Coverage, and Submit."},
|
||||
{"-M <model>, --test-model <model>", "Sets the model for a dashboard",
|
||||
"This option tells ctest to act as a Dart client "
|
||||
"where the TestModel can be Experimental, "
|
||||
"Nightly, and Continuous. Combining -M and -T is similar to -D"},
|
||||
{"-T <action>, --test-action <action>", "Sets the dashboard action to perform",
|
||||
{"-T <action>, --test-action <action>", "Sets the dashboard action to "
|
||||
"perform",
|
||||
"This option tells ctest to act as a Dart client "
|
||||
"and perform some action such as start, build, test etc. "
|
||||
"Combining -M and -T is similar to -D"},
|
||||
{"-S <script>, --script <script>", "Execute a dashboard for a configuration",
|
||||
{"-S <script>, --script <script>", "Execute a dashboard for a "
|
||||
"configuration",
|
||||
"This option tells ctest to load in a configuration script which sets "
|
||||
"a number of parameters such as the binary and source directories. Then "
|
||||
"ctest will do what is required to create and run a dashboard. This "
|
||||
"option basically sets up a dashboard and then runs ctest -D with the "
|
||||
"appropriate options."},
|
||||
{"-A <file>, --add-notes <file>", "Add a notes file with submission",
|
||||
"This option tells ctest to include a notes file when submitting dashboard. "},
|
||||
{"-I [Start,End,Stride,test#,test#|Test file], --tests-information",
|
||||
"This option tells ctest to include a notes file when submitting "
|
||||
"dashboard. "},
|
||||
{"-I [Start,End,Stride,test#,test#|Test file], --tests-information",
|
||||
"Run a specific number of tests by number.",
|
||||
"This option causes ctest to run tests starting at number Start, ending "
|
||||
"at number End, and incrementing by Stride. Any additional numbers after "
|
||||
@ -129,13 +135,14 @@ static const cmDocumentationEntry cmDocumentationOptions[] =
|
||||
"--test-command is specified then that will be run after the build is "
|
||||
"complete. Other options that affect this mode are --build-target "
|
||||
"--build-nocmake, --build-run-dir, "
|
||||
"--build-two-config, --build-exe-dir, --build-project,"
|
||||
"--build-two-config, --build-exe-dir, --build-project,"
|
||||
"--build-noclean, --build-options"},
|
||||
{"--build-target", "Specify a specific target to build.",
|
||||
"This option goes with the --build-and-test option, if left out the all target is built." },
|
||||
{"--build-nocmake", "Run the build without running cmake first.",
|
||||
{"--build-target", "Specify a specific target to build.",
|
||||
"This option goes with the --build-and-test option, if left out the all "
|
||||
"target is built." },
|
||||
{"--build-nocmake", "Run the build without running cmake first.",
|
||||
"Skip the cmake step." },
|
||||
{"--build-run-dir", "Specify directory to run programs from.",
|
||||
{"--build-run-dir", "Specify directory to run programs from.",
|
||||
"Directory where programs will be after it has been compiled." },
|
||||
{"--build-two-config", "Run CMake twice", "" },
|
||||
{"--build-exe-dir", "Specify the directory for the executable.", "" },
|
||||
@ -143,16 +150,19 @@ static const cmDocumentationEntry cmDocumentationOptions[] =
|
||||
{"--build-project", "Specify the name of the project to build.", "" },
|
||||
{"--build-makeprogram", "Specify the make program to use.", "" },
|
||||
{"--build-noclean", "Skip the make clean step.", "" },
|
||||
{"--build-options", "Add extra options to the build step.",
|
||||
"This option must be the last option with the exception of --test-command" },
|
||||
{"--build-options", "Add extra options to the build step.",
|
||||
"This option must be the last option with the exception of --test-command"
|
||||
},
|
||||
|
||||
{"--test-command", "The test to run with the --build-and-test option.", "" },
|
||||
{"--tomorrow-tag", "Nightly or experimental starts with next day tag.",
|
||||
{"--test-command", "The test to run with the --build-and-test option.", ""
|
||||
},
|
||||
{"--tomorrow-tag", "Nightly or experimental starts with next day tag.",
|
||||
"This is useful if the build will not finish in one day." },
|
||||
{"--ctest-config", "The configuration file used to initialize CTest state when submitting dashboards.",
|
||||
{"--ctest-config", "The configuration file used to initialize CTest state "
|
||||
"when submitting dashboards.",
|
||||
"This option tells CTest to use different initialization file instead of "
|
||||
"DartConfiguration.tcl. This way multiple initialization files can be used "
|
||||
"for example to submit to multiple dashboards." },
|
||||
"DartConfiguration.tcl. This way multiple initialization files can be "
|
||||
"used for example to submit to multiple dashboards." },
|
||||
{"--overwrite", "Overwrite CTest configuration option.",
|
||||
"By default ctest uses configuration options from configuration file. "
|
||||
"This option will overwrite the configuration option." },
|
||||
@ -160,12 +170,12 @@ static const cmDocumentationEntry cmDocumentationOptions[] =
|
||||
"This option will submit extra files to the dashboard." },
|
||||
{"--force-new-ctest-process", "Run child CTest instances as new processes",
|
||||
"By default CTest will run child CTest instances within the same process. "
|
||||
"If this behavior is not desired, this argument will enforce new processes "
|
||||
"for child CTest processes." },
|
||||
"If this behavior is not desired, this argument will enforce new "
|
||||
"processes for child CTest processes." },
|
||||
{"--submit-index", "Submit individual dashboard tests with specific index",
|
||||
"This option allows performing the same CTest action (such as test) multiple "
|
||||
"times and submit all stages to the same dashboard (Dart2 required). "
|
||||
"Each execution requires different index." },
|
||||
"This option allows performing the same CTest action (such as test) "
|
||||
"multiple times and submit all stages to the same dashboard (Dart2 "
|
||||
"required). Each execution requires different index." },
|
||||
{0,0,0}
|
||||
};
|
||||
|
||||
@ -186,12 +196,13 @@ int main (int argc, char *argv[])
|
||||
|
||||
if ( cmSystemTools::GetCurrentWorkingDirectory().size() == 0 )
|
||||
{
|
||||
cmCTestLog(&inst, ERROR_MESSAGE, "Current working directory cannot be established." << std::endl);
|
||||
cmCTestLog(&inst, ERROR_MESSAGE,
|
||||
"Current working directory cannot be established." << std::endl);
|
||||
nocwd = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// If there is a testing input file, check for documentation options
|
||||
// only if there are actually arguments. We want running without
|
||||
// arguments to run tests.
|
||||
@ -200,7 +211,8 @@ int main (int argc, char *argv[])
|
||||
{
|
||||
if(argc == 1)
|
||||
{
|
||||
cmCTestLog(&inst, ERROR_MESSAGE, "*********************************" << std::endl
|
||||
cmCTestLog(&inst, ERROR_MESSAGE, "*********************************"
|
||||
<< std::endl
|
||||
<< "No test configuration file found!" << std::endl
|
||||
<< "*********************************" << std::endl);
|
||||
}
|
||||
@ -221,8 +233,7 @@ int main (int argc, char *argv[])
|
||||
#define cout no_cout_use_cmCTestLog
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
std::string comspec = "cmw9xcom.exe";
|
||||
cmSystemTools::SetWindows9xComspecSubstitute(comspec.c_str());
|
||||
|
Loading…
x
Reference in New Issue
Block a user