STYLE: Fix some style issues

This commit is contained in:
Andy Cedilnik 2006-03-09 11:57:43 -05:00
parent cb95c0a5bc
commit 26e1fea95b
3 changed files with 294 additions and 199 deletions

View File

@ -9,8 +9,8 @@
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information. PURPOSE. See the above copyright notices for more information.
=========================================================================*/ =========================================================================*/
@ -42,7 +42,7 @@
#include <cmsys/RegularExpression.hxx> #include <cmsys/RegularExpression.hxx>
#include <cmsys/Process.h> #include <cmsys/Process.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include <float.h> #include <float.h>
@ -52,7 +52,7 @@
#define DEBUGERR std::cerr << __LINE__ << " "; std::cerr #define DEBUGERR std::cerr << __LINE__ << " "; std::cerr
//---------------------------------------------------------------------- //----------------------------------------------------------------------
struct tm* cmCTest::GetNightlyTime(std::string str, struct tm* cmCTest::GetNightlyTime(std::string str,
bool tomorrowtag) bool tomorrowtag)
{ {
struct tm* lctime; struct tm* lctime;
@ -81,7 +81,8 @@ struct tm* cmCTest::GetNightlyTime(std::string str,
// time of the current open dashboard // time of the current open dashboard
ntime -= dayLength; ntime -= dayLength;
cmCTestLog(this, DEBUG, "Pick yesterday" << std::endl); 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) ) while ( tctime > (ntime + dayLength) )
{ {
@ -145,7 +146,8 @@ std::string cmCTest::MakeXMLSafe(const std::string& str)
for ( ;*pos; ++pos) for ( ;*pos; ++pos)
{ {
char ch = *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]; char buffer[33];
sprintf(buffer, "&lt;%d&gt;", (int)ch); sprintf(buffer, "&lt;%d&gt;", (int)ch);
@ -198,7 +200,7 @@ std::string cmCTest::MakeURLSafe(const std::string& str)
ch == '&' || ch == '&' ||
ch == '%' || ch == '%' ||
ch == '+' || ch == '+' ||
ch == '=' || ch == '=' ||
ch == '@' ch == '@'
) && ch != 9 ) ) && ch != 9 )
{ {
@ -214,8 +216,8 @@ std::string cmCTest::MakeURLSafe(const std::string& str)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
cmCTest::cmCTest() cmCTest::cmCTest()
{ {
m_SubmitIndex = 0; m_SubmitIndex = 0;
m_ForceNewCTestProcess = false; m_ForceNewCTestProcess = false;
m_TomorrowTag = false; m_TomorrowTag = false;
@ -237,7 +239,7 @@ cmCTest::cmCTest()
m_SuppressUpdatingCTestConfiguration = false; m_SuppressUpdatingCTestConfiguration = false;
m_DartVersion = 1; m_DartVersion = 1;
int cc; int cc;
for ( cc=0; cc < cmCTest::LAST_TEST; cc ++ ) for ( cc=0; cc < cmCTest::LAST_TEST; cc ++ )
{ {
m_Tests[cc] = 0; m_Tests[cc] = 0;
@ -265,8 +267,8 @@ cmCTest::cmCTest()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
cmCTest::~cmCTest() cmCTest::~cmCTest()
{ {
cmCTest::t_TestingHandlers::iterator it; 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 )
{ {
@ -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); cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
if(!m_InteractiveDebugMode) if(!m_InteractiveDebugMode)
{ {
this->BlockTestErrorDiagnostics(); this->BlockTestErrorDiagnostics();
} }
m_BinaryDir = binary_dir; m_BinaryDir = binary_dir;
cmSystemTools::ConvertToUnixSlashes(m_BinaryDir); 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, DEBUG, "Here: " << __LINE__ << std::endl);
cmCTestLog(this, OUTPUT, cmCTestLog(this, OUTPUT,
" Site: " << this->GetCTestConfiguration("Site") << std::endl " 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); cmCTestLog(this, DEBUG, "Produce XML is on" << std::endl);
if ( this->GetCTestConfiguration("NightlyStartTime").empty() ) 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()) ) 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; 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()) ) if ( !cmSystemTools::FileIsDirectory(testingDir.c_str()) )
{ {
cmCTestLog(this, ERROR_MESSAGE, "File " << testingDir << " is in the place of the testing directory" cmCTestLog(this, ERROR_MESSAGE, "File " << testingDir
<< std::endl); << " is in the place of the testing directory" << std::endl);
return 0; 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()) ) if ( !cmSystemTools::MakeDirectory(testingDir.c_str()) )
{ {
cmCTestLog(this, ERROR_MESSAGE, "Cannot create directory " << testingDir cmCTestLog(this, ERROR_MESSAGE, "Cannot create directory "
<< std::endl); << testingDir << std::endl);
return 0; return 0;
} }
} }
@ -361,20 +365,24 @@ int cmCTest::Initialize(const char* binary_dir, bool new_tag, bool verbose_tag)
std::string tagmode; std::string tagmode;
if ( cmSystemTools::GetLineFromStream(tfin, 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()); m_TestModel = cmCTest::GetTestModelFromString(tagmode.c_str());
} }
} }
tfin.close(); 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); cmCTestLog(this, DEBUG, "TestModel: " << m_TestModel << std::endl);
if ( m_TestModel == cmCTest::NIGHTLY ) if ( m_TestModel == cmCTest::NIGHTLY )
{ {
lctime = this->GetNightlyTime(this->GetCTestConfiguration("NightlyStartTime"), m_TomorrowTag); lctime = this->GetNightlyTime(
this->GetCTestConfiguration("NightlyStartTime"), m_TomorrowTag);
} }
char datestring[100]; char datestring[100];
sprintf(datestring, "%04d%02d%02d-%02d%02d", 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(); ofs.close();
if ( verbose_tag ) if ( verbose_tag )
{ {
cmCTestLog(this, OUTPUT, "Create new tag: " << tag << " - " cmCTestLog(this, OUTPUT, "Create new tag: " << tag << " - "
<< this->GetTestModelString() << std::endl); << this->GetTestModelString() << std::endl);
} }
} }
@ -410,7 +418,8 @@ bool cmCTest::InitializeFromCommand(cmCTestCommand* command, bool first)
return true; 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(); std::string bld_dir = this->GetCTestConfiguration("BuildDirectory").c_str();
m_DartVersion = 1; m_DartVersion = 1;
m_SubmitFiles.clear(); m_SubmitFiles.clear();
@ -421,8 +430,9 @@ bool cmCTest::InitializeFromCommand(cmCTestCommand* command, bool first)
cmSystemTools::ConvertToUnixSlashes(fname); cmSystemTools::ConvertToUnixSlashes(fname);
if ( cmSystemTools::FileExists(fname.c_str()) ) if ( cmSystemTools::FileExists(fname.c_str()) )
{ {
cmCTestLog(this, OUTPUT, " Reading ctest configuration file: " << fname.c_str() << std::endl); cmCTestLog(this, OUTPUT, " Reading ctest configuration file: "
bool readit = mf->ReadListFile(mf->GetCurrentListFile(), << fname.c_str() << std::endl);
bool readit = mf->ReadListFile(mf->GetCurrentListFile(),
fname.c_str() ); fname.c_str() );
if(!readit) if(!readit)
{ {
@ -434,24 +444,30 @@ bool cmCTest::InitializeFromCommand(cmCTestCommand* command, bool first)
} }
else if ( !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 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); << " 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, "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"); const char* dartVersion = mf->GetDefinition("CTEST_DART_SERVER_VERSION");
if ( dartVersion ) if ( dartVersion )
{ {
m_DartVersion = atoi(dartVersion); m_DartVersion = atoi(dartVersion);
if ( m_DartVersion < 0 ) 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; return false;
} }
} }
@ -464,7 +480,8 @@ bool cmCTest::InitializeFromCommand(cmCTestCommand* command, bool first)
} }
return false; 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; return true;
} }
@ -490,7 +507,8 @@ bool cmCTest::UpdateCTestConfiguration()
// No need to exit if we are not producing XML // No need to exit if we are not producing XML
if ( m_ProduceXML ) 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; return false;
} }
} }
@ -532,7 +550,8 @@ bool cmCTest::UpdateCTestConfiguration()
continue; continue;
} }
std::string key = line.substr(0, cpos); 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; m_CTestConfiguration[key] = value;
} }
fin.close(); fin.close();
@ -540,7 +559,8 @@ bool cmCTest::UpdateCTestConfiguration()
m_TimeOut = atoi(this->GetCTestConfiguration("TimeOut").c_str()); m_TimeOut = atoi(this->GetCTestConfiguration("TimeOut").c_str());
if ( m_ProduceXML ) if ( m_ProduceXML )
{ {
m_CompressXMLFiles = cmSystemTools::IsOn(this->GetCTestConfiguration("CompressSubmission").c_str()); m_CompressXMLFiles = cmSystemTools::IsOn(
this->GetCTestConfiguration("CompressSubmission").c_str());
} }
return true; return true;
} }
@ -551,7 +571,7 @@ void cmCTest::BlockTestErrorDiagnostics()
cmSystemTools::PutEnv("DART_TEST_FROM_DART=1"); cmSystemTools::PutEnv("DART_TEST_FROM_DART=1");
cmSystemTools::PutEnv("DASHBOARD_TEST_FROM_CTEST=" CMake_VERSION); cmSystemTools::PutEnv("DASHBOARD_TEST_FROM_CTEST=" CMake_VERSION);
#if defined(_WIN32) #if defined(_WIN32)
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
#endif #endif
} }
@ -609,7 +629,8 @@ bool cmCTest::SetTest(const char* ttype, bool report)
{ {
if ( 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; 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, const std::string& name, cmGeneratedFileStream& stream,
bool compress) bool compress)
{ {
@ -635,7 +656,7 @@ bool cmCTest::OpenOutputFile(const std::string& path,
{ {
if ( !cmSystemTools::FileIsDirectory(testingDir.c_str()) ) 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" << " is in the place of the testing directory"
<< std::endl); << std::endl);
return false; return false;
@ -654,7 +675,8 @@ bool cmCTest::OpenOutputFile(const std::string& path,
stream.Open(filename.c_str()); stream.Open(filename.c_str());
if( !stream ) if( !stream )
{ {
cmCTestLog(this, ERROR_MESSAGE, "Problem opening file: " << filename << std::endl); cmCTestLog(this, ERROR_MESSAGE, "Problem opening file: " << filename
<< std::endl);
return false; return false;
} }
if ( compress ) if ( compress )
@ -730,7 +752,7 @@ int cmCTest::ExecuteHandler(const char* shandler)
return -1; return -1;
} }
handler->Initialize(); handler->Initialize();
return handler->ProcessHandler(); return handler->ProcessHandler();
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -754,8 +776,9 @@ int cmCTest::ProcessTests()
if ( m_Tests[UPDATE_TEST] || m_Tests[ALL_TEST] ) if ( m_Tests[UPDATE_TEST] || m_Tests[ALL_TEST] )
{ {
cmCTestGenericHandler* uphandler = this->GetHandler("update"); cmCTestGenericHandler* uphandler = this->GetHandler("update");
uphandler->SetOption("SourceDirectory", this->GetCTestConfiguration("SourceDirectory").c_str()); uphandler->SetOption("SourceDirectory",
update_count = uphandler->ProcessHandler(); this->GetCTestConfiguration("SourceDirectory").c_str());
update_count = uphandler->ProcessHandler();
if ( update_count < 0 ) if ( update_count < 0 )
{ {
res |= cmCTest::UPDATE_ERRORS; res |= cmCTest::UPDATE_ERRORS;
@ -847,7 +870,8 @@ int cmCTest::ProcessTests()
} }
if ( res != 0 ) 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; 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, " \"" << *ait << "\"");
} }
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, std::endl); cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, std::endl);
// Now create process object // Now create process object
cmsysProcess* cp = cmsysProcess_New(); cmsysProcess* cp = cmsysProcess_New();
cmsysProcess_SetCommand(cp, &*argv.begin()); cmsysProcess_SetCommand(cp, &*argv.begin());
@ -981,22 +1005,25 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
if(result == cmsysProcess_State_Exited) if(result == cmsysProcess_State_Exited)
{ {
*retVal = cmsysProcess_GetExitValue(cp); *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) else if(result == cmsysProcess_State_Exception)
{ {
*retVal = cmsysProcess_GetExitException(cp); *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) else if(result == cmsysProcess_State_Expired)
{ {
cmCTestLog(this, WARNING, "There was a timeout" << std::endl); cmCTestLog(this, WARNING, "There was a timeout" << std::endl);
} }
else if(result == cmsysProcess_State_Error) else if(result == cmsysProcess_State_Error)
{ {
*output += "\n*** ERROR executing: "; *output += "\n*** ERROR executing: ";
*output += cmsysProcess_GetErrorString(cp); *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); 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::string* output, int *retVal,
std::ostream* log) std::ostream* log)
{ {
if(cmSystemTools::SameFile(argv[0], m_CTestSelf.c_str()) && if(cmSystemTools::SameFile(argv[0], m_CTestSelf.c_str()) &&
!m_ForceNewCTestProcess) !m_ForceNewCTestProcess)
{ {
cmCTest inst; cmCTest inst;
@ -1033,15 +1060,16 @@ int cmCTest::RunTest(std::vector<const char*> argv,
*log << "* Run internal CTest" << std::endl; *log << "* Run internal CTest" << std::endl;
} }
std::string oldpath = cmSystemTools::GetCurrentWorkingDirectory(); std::string oldpath = cmSystemTools::GetCurrentWorkingDirectory();
*retVal = inst.Run(args, output); *retVal = inst.Run(args, output);
if ( *log ) if ( *log )
{ {
*log << output->c_str(); *log << output->c_str();
} }
cmSystemTools::ChangeDirectory(oldpath.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); << *output << std::endl);
return cmsysProcess_State_Exited; return cmsysProcess_State_Exited;
} }
@ -1081,7 +1109,8 @@ int cmCTest::RunTest(std::vector<const char*> argv,
{ {
output->append(&*tempOutput.begin(), tempOutput.size()); 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); int result = cmsysProcess_GetState(cp);
@ -1095,14 +1124,16 @@ int cmCTest::RunTest(std::vector<const char*> argv,
std::string outerr = "\n*** Exception executing: "; std::string outerr = "\n*** Exception executing: ";
outerr += cmsysProcess_GetExceptionString(cp); outerr += cmsysProcess_GetExceptionString(cp);
*output += outerr; *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) else if(result == cmsysProcess_State_Error)
{ {
std::string outerr = "\n*** ERROR executing: "; std::string outerr = "\n*** ERROR executing: ";
outerr += cmsysProcess_GetErrorString(cp); outerr += cmsysProcess_GetErrorString(cp);
*output += outerr; *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); 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; cmCTest::tm_VectorOfStrings::const_iterator it;
os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" 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" << "<?xml-stylesheet type=\"text/xsl\" "
<< "<Site BuildName=\"" << this->GetCTestConfiguration("BuildName") << "\" BuildStamp=\"" "href=\"Dart/Source/Server/XSL/Build.xsl "
<< m_CurrentTag << "-" << this->GetTestModelString() << "\" Name=\"" "<file:///Dart/Source/Server/XSL/Build.xsl> \"?>\n"
<< "<Site BuildName=\"" << this->GetCTestConfiguration("BuildName")
<< "\" BuildStamp=\""
<< m_CurrentTag << "-" << this->GetTestModelString() << "\" Name=\""
<< this->GetCTestConfiguration("Site") << "\" Generator=\"ctest" << this->GetCTestConfiguration("Site") << "\" Generator=\"ctest"
<< cmVersion::GetCMakeVersion() << cmVersion::GetCMakeVersion()
<< "\">\n" << "\">\n"
@ -1160,7 +1195,8 @@ int cmCTest::GenerateCTestNotesOutput(std::ostream& os, const cmCTest::tm_Vector
else else
{ {
os << "Problem reading file: " << it->c_str() << std::endl; 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" os << "</Text>\n"
<< "</Note>" << std::endl; << "</Note>" << std::endl;
@ -1215,7 +1251,8 @@ bool cmCTest::SubmitExtraFiles(const std::vector<cmStdString> &files)
{ {
if ( !cmSystemTools::FileExists(it->c_str()) ) 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;); << std::endl;);
return false; 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 ) 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]; 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++; i++;
this->m_ConfigType = args[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; this->m_RunConfigurationScript = true;
i++; i++;
cmCTestScriptHandler* ch = static_cast<cmCTestScriptHandler*>(this->GetHandler("script")); cmCTestScriptHandler* ch
= static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
ch->AddConfigurationScript(args[i].c_str()); 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; 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++; i++;
m_InteractiveDebugMode = cmSystemTools::IsOn(args[i].c_str()); 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->SetTestModel(cmCTest::CONTINUOUS);
this->SetTest("Update"); this->SetTest("Update");
} }
else if ( targ == "ContinuousConfigure" ) else if ( targ == "ContinuousConfigure" )
{ {
this->SetTestModel(cmCTest::CONTINUOUS); this->SetTestModel(cmCTest::CONTINUOUS);
@ -1525,29 +1566,38 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
else else
{ {
performSomeTest = false; 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 cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
<< " " << ctestExec << " -D Continuous" << std::endl << " " << ctestExec << " -D Continuous" << std::endl
<< " " << ctestExec << " -D Continuous(Start|Update|Configure|Build)" << std::endl << " " << ctestExec
<< " " << ctestExec << " -D Continuous(Test|Coverage|MemCheck|Submit)" << std::endl << " -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" << std::endl
<< " " << ctestExec << " -D Experimental(Start|Update|Configure|Build)" << std::endl << " " << ctestExec
<< " " << ctestExec << " -D Experimental(Test|Coverage|MemCheck|Submit)" << std::endl << " -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" << std::endl
<< " " << ctestExec << " -D Nightly(Start|Update|Configure|Build)" << std::endl << " " << ctestExec
<< " " << ctestExec << " -D Nightly(Test|Coverage|MemCheck|Submit)" << std::endl << " -D Nightly(Start|Update|Configure|Build)" << std::endl
<< " " << ctestExec
<< " -D Nightly(Test|Coverage|MemCheck|Submit)" << std::endl
<< " " << ctestExec << " -D NightlyMemoryCheck" << 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; this->m_ProduceXML = true;
i++; i++;
if ( !this->SetTest(args[i].c_str(), false) ) if ( !this->SetTest(args[i].c_str(), false) )
{ {
performSomeTest = 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); << args[i].c_str() << std::endl);
cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
<< " " << ctestExec << " -T all" << 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++; i++;
std::string const& str = args[i]; std::string const& str = args[i];
@ -1582,7 +1633,9 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
else else
{ {
performSomeTest = false; 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 cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
<< " " << ctestExec << " -M Continuous" << std::endl << " " << ctestExec << " -M Continuous" << std::endl
<< " " << ctestExec << " -M Experimental" << 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++; 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")) if(this->CheckArgument(arg, "-U", "--union"))
{ {
this->GetHandler("test")->SetOption("UseUnion", "true"); this->GetHandler("test")->SetOption("UseUnion", "true");
} }
if(this->CheckArgument(arg, "-R", "--tests-regex") && i < args.size() - 1) 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)
{
i++; 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) 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; cmakeAndTest = true;
} }
cmCTest::t_TestingHandlers::iterator it; 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) ) 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; return 0;
} }
} }
@ -1660,7 +1721,7 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
if(cmakeAndTest) if(cmakeAndTest)
{ {
m_Verbose = true; m_Verbose = true;
cmCTestBuildAndTestHandler* handler = cmCTestBuildAndTestHandler* handler =
static_cast<cmCTestBuildAndTestHandler*>(this->GetHandler("buildtest")); static_cast<cmCTestBuildAndTestHandler*>(this->GetHandler("buildtest"));
int retv = handler->ProcessHandler(); int retv = handler->ProcessHandler();
*output = handler->GetOutput(); *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); cmCTestLog(this, OUTPUT, "* Extra verbosity turned on" << std::endl);
} }
cmCTest::t_TestingHandlers::iterator it; 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->SetVerbose(this->m_ExtraVerbose);
it->second->SetSubmitIndex(m_SubmitIndex); 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_ExtraVerbose = m_Verbose;
m_Verbose = true; m_Verbose = true;
cmCTest::t_TestingHandlers::iterator it; 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->SetVerbose(this->m_Verbose);
it->second->SetSubmitIndex(m_SubmitIndex); it->second->SetSubmitIndex(m_SubmitIndex);
} }
cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl); 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); cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
res = 12; res = 12;
cmCTestLog(this, ERROR_MESSAGE, "Problem initializing the dashboard." << std::endl); cmCTestLog(this, ERROR_MESSAGE, "Problem initializing the dashboard."
<< std::endl);
} }
else else
{ {
@ -1817,11 +1884,13 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir)
for ( fileIt = files.begin(); fileIt != files.end(); for ( fileIt = files.begin(); fileIt != files.end();
++ fileIt ) ++ 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()) || if ( !lg->GetMakefile()->ReadListFile(0, fileIt->c_str()) ||
cmSystemTools::GetErrorOccuredFlag() ) 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); it->second->PopulateCustomVectors(mf);
} }
return 1; 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) if ( !def)
{ {
@ -1874,7 +1944,8 @@ void cmCTest::PopulateCustomInteger(cmMakefile* mf, const char* def, int& val)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
std::string cmCTest::GetShortPathToFile(const char* cfname) 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"); const std::string& buildDir = this->GetCTestConfiguration("BuildDirectory");
std::string fname = cmSystemTools::CollapseFullPath(cfname); std::string fname = cmSystemTools::CollapseFullPath(cfname);
@ -1928,7 +1999,8 @@ std::string cmCTest::GetShortPathToFile(const char* cfname)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
std::string cmCTest::GetCTestConfiguration(const char *name) 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]; return m_CTestConfigurationOverwrites[name];
} }
@ -1956,7 +2028,7 @@ void cmCTest::SetCTestConfiguration(const char *name, const char* value)
m_CTestConfiguration[name] = value; m_CTestConfiguration[name] = value;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
std::string cmCTest::GetCurrentTag() std::string cmCTest::GetCurrentTag()
{ {
@ -2007,7 +2079,8 @@ void cmCTest::AddCTestConfigurationOverwrite(const char* encstr)
if ( epos == overStr.npos ) if ( epos == overStr.npos )
{ {
cmCTestLog(this, ERROR_MESSAGE, 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 << "Valid format is: --overwrite key=value" << std::endl
<< "The specified was: --overwrite " << overStr.c_str() << std::endl); << "The specified was: --overwrite " << overStr.c_str() << std::endl);
return; 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; const char* ctvar;
ctvar = mf->GetDefinition(cmake_var); ctvar = mf->GetDefinition(cmake_var);
@ -2031,10 +2105,10 @@ bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf, const char*
} }
bool cmCTest::RunCommand( bool cmCTest::RunCommand(
const char* command, const char* command,
std::string* stdOut, std::string* stdOut,
std::string* stdErr, std::string* stdErr,
int *retVal, int *retVal,
const char* dir, const char* dir,
double timeout) double timeout)
{ {
@ -2044,7 +2118,7 @@ bool cmCTest::RunCommand(
{ {
return false; return false;
} }
std::vector<const char*> argv; std::vector<const char*> argv;
for(std::vector<cmStdString>::const_iterator a = args.begin(); for(std::vector<cmStdString>::const_iterator a = args.begin();
a != args.end(); ++a) a != args.end(); ++a)
@ -2065,7 +2139,7 @@ bool cmCTest::RunCommand(
} }
cmsysProcess_SetTimeout(cp, timeout); cmsysProcess_SetTimeout(cp, timeout);
cmsysProcess_Execute(cp); cmsysProcess_Execute(cp);
std::vector<char> tempOutput; std::vector<char> tempOutput;
std::vector<char> tempError; std::vector<char> tempError;
char* data; char* data;
@ -2086,16 +2160,17 @@ bool cmCTest::RunCommand(
default: default:
done = true; 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); cmSystemTools::Stdout(data, length);
} }
} }
cmsysProcess_WaitForExit(cp, 0); cmsysProcess_WaitForExit(cp, 0);
stdOut->append(&*tempOutput.begin(), tempOutput.size()); stdOut->append(&*tempOutput.begin(), tempOutput.size());
stdErr->append(&*tempError.begin(), tempError.size()); stdErr->append(&*tempError.begin(), tempError.size());
bool result = true; bool result = true;
if(cmsysProcess_GetState(cp) == cmsysProcess_State_Exited) if(cmsysProcess_GetState(cp) == cmsysProcess_State_Exited)
{ {
@ -2132,7 +2207,7 @@ bool cmCTest::RunCommand(
stdErr->append(error_str, strlen(error_str)); stdErr->append(error_str, strlen(error_str));
result = false; result = false;
} }
cmsysProcess_Delete(cp); cmsysProcess_Delete(cp);
return result; return result;
} }
@ -2152,7 +2227,7 @@ void cmCTest::SetOutputLogFileName(const char* name)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
static const char* cmCTestStringLogType[] = static const char* cmCTestStringLogType[] =
{ {
"DEBUG", "DEBUG",
"OUTPUT", "OUTPUT",
@ -2187,7 +2262,8 @@ void cmCTest::Log(int logType, const char* file, int line, const char* msg)
{ {
bool display = true; bool display = true;
if ( logType == cmCTest::DEBUG && !m_Debug ) { display = false; } 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 ) if ( display )
{ {
cmCTestLogOutputFileLine(*m_OutputLogFile); cmCTestLogOutputFileLine(*m_OutputLogFile);

View File

@ -9,8 +9,8 @@
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information. PURPOSE. See the above copyright notices for more information.
=========================================================================*/ =========================================================================*/
@ -32,7 +32,8 @@ class cmCTestCommand;
do { \ do { \
cmOStringStream cmCTestLog_msg; \ cmOStringStream cmCTestLog_msg; \
cmCTestLog_msg << 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 ) } while ( 0 )
#ifdef cerr #ifdef cerr
@ -53,11 +54,12 @@ public:
///! Process Command line arguments ///! Process Command line arguments
int Run(std::vector<std::string>const&, std::string* output = 0); int Run(std::vector<std::string>const&, std::string* output = 0);
/** /**
* Initialize and finalize testing * 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); bool InitializeFromCommand(cmCTestCommand* command, bool first = false);
void Finalize(); void Finalize();
@ -76,14 +78,14 @@ public:
/* /*
* A utility function that returns the nightly time * A utility function that returns the nightly time
*/ */
struct tm* GetNightlyTime(std::string str, struct tm* GetNightlyTime(std::string str,
bool tomorrowtag); bool tomorrowtag);
/* /*
* Is the tomorrow tag set? * Is the tomorrow tag set?
*/ */
bool GetTomorrowTag() { return m_TomorrowTag; }; bool GetTomorrowTag() { return m_TomorrowTag; };
/** /**
* Try to run tests of the project * Try to run tests of the project
*/ */
@ -93,7 +95,7 @@ public:
std::string GetConfigType(); std::string GetConfigType();
double GetTimeOut() { return m_TimeOut; } double GetTimeOut() { return m_TimeOut; }
void SetTimeOut(double t) { m_TimeOut = t; } void SetTimeOut(double t) { m_TimeOut = t; }
/** /**
* Check if CTest file exists * Check if CTest file exists
*/ */
@ -110,32 +112,33 @@ public:
*/ */
void SetTestModel(int mode); void SetTestModel(int mode);
int GetTestModel() { return m_TestModel; }; int GetTestModel() { return m_TestModel; };
std::string GetTestModelString(); std::string GetTestModelString();
static int GetTestModelFromString(const char* str); static int GetTestModelFromString(const char* str);
static std::string CleanString(const std::string& str); static std::string CleanString(const std::string& str);
std::string GetCTestConfiguration(const char *name); std::string GetCTestConfiguration(const char *name);
void SetCTestConfiguration(const char *name, const char* value); void SetCTestConfiguration(const char *name, const char* value);
void EmptyCTestConfiguration(); void EmptyCTestConfiguration();
/** /**
* constructor and destructor * constructor and destructor
*/ */
cmCTest(); cmCTest();
~cmCTest(); ~cmCTest();
//! Set the notes files to be created. //! Set the notes files to be created.
void SetNotesFiles(const char* notes); void SetNotesFiles(const char* notes);
static void PopulateCustomVector(cmMakefile* mf, const char* definition, static void PopulateCustomVector(cmMakefile* mf, const char* definition,
tm_VectorOfStrings& vec); 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 ///! Get the current time as string
std::string CurrentTime(); std::string CurrentTime();
///! Open file in the output directory and set the stream ///! 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, const std::string& name,
cmGeneratedFileStream& stream, cmGeneratedFileStream& stream,
bool compress = false); bool compress = false);
@ -147,7 +150,7 @@ public:
bool GetShowOnly(); 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. * in output.
* *
* If verbose is false, no user-viewable output from the program * If verbose is false, no user-viewable output from the program
@ -157,19 +160,19 @@ public:
* timeout expires. Timeout is specified in seconds. * timeout expires. Timeout is specified in seconds.
* *
* Argument retVal should be a pointer to the location where the * Argument retVal should be a pointer to the location where the
* exit code will be stored. If the retVal is not specified and * exit code will be stored. If the retVal is not specified and
* the program exits with a code other than 0, then the this * the program exits with a code other than 0, then the this
* function will return false. * function will return false.
* *
* If the command has spaces in the path the caller MUST call * If the command has spaces in the path the caller MUST call
* cmSystemTools::ConvertToRunCommandPath on the command before passing * cmSystemTools::ConvertToRunCommandPath on the command before passing
* it into this function or it will not work. The command must be correctly * 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, bool RunCommand(const char* command,
std::string* stdOut, std::string* stdErr, std::string* stdOut, std::string* stdErr,
int* retVal = 0, const char* dir = 0, double timeout = 0.0); int* retVal = 0, const char* dir = 0, double timeout = 0.0);
//! Start CTest XML output file //! Start CTest XML output file
void StartXML(std::ostream& ostr); void StartXML(std::ostream& ostr);
@ -179,7 +182,7 @@ public:
//! Run command specialized for make and configure. Returns process status //! Run command specialized for make and configure. Returns process status
// and retVal is return value or exception. // and retVal is return value or exception.
int RunMakeCommand(const char* command, std::string* output, 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); std::ofstream& ofs);
/* /*
@ -189,7 +192,7 @@ public:
//! Get the path to the build tree //! Get the path to the build tree
std::string GetBinaryDir(); std::string GetBinaryDir();
//! Get the short path to the file. This means if the file is in binary or //! 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 //source directory, it will become /.../relative/path/to/file
std::string GetShortPathToFile(const char* fname); std::string GetShortPathToFile(const char* fname);
@ -221,15 +224,16 @@ public:
//! Run command specialized for tests. Returns process status and retVal is //! Run command specialized for tests. Returns process status and retVal is
// return value or exception. // 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); 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); int ExecuteHandler(const char* handler);
/* /*
* Get the handler object * Get the handler object
*/ */
cmCTestGenericHandler* GetHandler(const char* handler); cmCTestGenericHandler* GetHandler(const char* handler);
@ -238,13 +242,14 @@ public:
/* /*
* Set the CTest variable from CMake variable * 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 //! Make string safe to be send as an URL
static std::string MakeURLSafe(const std::string&); static std::string MakeURLSafe(const std::string&);
//! Should ctect configuration be updated. When using new style ctest script, //! Should ctect configuration be updated. When using new style ctest
// this should be true. // script, this should be true.
void SetSuppressUpdatingCTestConfiguration(bool val) void SetSuppressUpdatingCTestConfiguration(bool val)
{ {
m_SuppressUpdatingCTestConfiguration = val; m_SuppressUpdatingCTestConfiguration = val;
@ -300,7 +305,7 @@ private:
// these are helper classes // these are helper classes
typedef std::map<cmStdString,cmCTestGenericHandler*> t_TestingHandlers; typedef std::map<cmStdString,cmCTestGenericHandler*> t_TestingHandlers;
t_TestingHandlers m_TestingHandlers; t_TestingHandlers m_TestingHandlers;
bool m_ShowOnly; bool m_ShowOnly;
enum { enum {
@ -317,7 +322,7 @@ private:
ALL_TEST = 10, ALL_TEST = 10,
LAST_TEST = 11 LAST_TEST = 11
}; };
//! Map of configuration properties //! Map of configuration properties
typedef std::map<cmStdString, cmStdString> tm_CTestConfigurationMap; typedef std::map<cmStdString, cmStdString> tm_CTestConfigurationMap;
@ -325,7 +330,7 @@ private:
tm_CTestConfigurationMap m_CTestConfiguration; tm_CTestConfigurationMap m_CTestConfiguration;
tm_CTestConfigurationMap m_CTestConfigurationOverwrites; tm_CTestConfigurationMap m_CTestConfigurationOverwrites;
int m_Tests[LAST_TEST]; int m_Tests[LAST_TEST];
std::string m_CurrentTag; std::string m_CurrentTag;
bool m_TomorrowTag; bool m_TomorrowTag;
@ -341,7 +346,7 @@ private:
std::string m_BinaryDir; std::string m_BinaryDir;
std::string m_NotesFiles; std::string m_NotesFiles;
int ReadCustomConfigurationFileTree(const char* dir); int ReadCustomConfigurationFileTree(const char* dir);
@ -350,21 +355,23 @@ private:
bool m_ShortDateFormat; bool m_ShortDateFormat;
bool m_CompressXMLFiles; bool m_CompressXMLFiles;
void BlockTestErrorDiagnostics(); void BlockTestErrorDiagnostics();
//! Reread the configuration file //! Reread the configuration file
bool UpdateCTestConfiguration(); bool UpdateCTestConfiguration();
//! Create not from files. //! 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 ///! Find the running cmake
void FindRunningCMake(const char* arg0); void FindRunningCMake(const char* arg0);
//! Check if the argument is the one specified //! 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; bool m_SuppressUpdatingCTestConfiguration;
@ -377,7 +384,7 @@ private:
std::set<cmStdString> m_SubmitFiles; std::set<cmStdString> m_SubmitFiles;
int m_SubmitIndex; int m_SubmitIndex;
cmGeneratedFileStream* m_OutputLogFile; cmGeneratedFileStream* m_OutputLogFile;
int m_OutputLogFileLastTag; int m_OutputLogFileLastTag;
}; };
@ -385,7 +392,8 @@ private:
class cmCTestLogWrite class cmCTestLogWrite
{ {
public: 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; const char* Data;
size_t Length; size_t Length;

View File

@ -9,8 +9,8 @@
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information. 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 " "Test output is normally suppressed and only summary information is "
"displayed. This option will show even more test output."}, "displayed. This option will show even more test output."},
{"--debug", "Displaying more verbose internals of CTest.", {"--debug", "Displaying more verbose internals of CTest.",
"This feature will result in large number of output that is mostly useful " "This feature will result in large number of output that is mostly "
"for debugging dashboard problems."}, "useful for debugging dashboard problems."},
{"-Q,--quiet", "Make ctest quiet.", {"-Q,--quiet", "Make ctest quiet.",
"This option will suppress all the output. The output log file will still be " "This option will suppress all the output. The output log file will "
"generated if the --output-log is specified. Options such as --verbose, " "still be generated if the --output-log is specified. Options such "
"--extra-verbose, and --debug are ignored if --quiet is specified."}, "as --verbose, --extra-verbose, and --debug are ignored if --quiet is "
"specified."},
{"-O <file>, --output-log <file>", "Output to log file", {"-O <file>, --output-log <file>", "Output to log file",
"This option tells ctest to write all its output to a log file."}, "This option tells ctest to write all its output to a log file."},
{"-N,--show-only", "Disable actual execution of tests.", {"-N,--show-only", "Disable actual execution of tests.",
"This option tells ctest to list the tests that would be run but not " "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."}, "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 " "This option tells ctest to run only the tests whose names match the "
"given regular expression."}, "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 " "This option tells ctest to NOT run the tests whose names match the "
"given regular expression."}, "given regular expression."},
{"-D <dashboard>, --dashboard <dashboard>", "Execute dashboard test", {"-D <dashboard>, --dashboard <dashboard>", "Execute dashboard test",
"This option tells ctest to perform act as a Dart client and perform " "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, " "a dashboard test. All tests are <Mode><Test>, where Mode can be "
"Nightly, and Continuous, and Test can be Start, Update, Configure, " "Experimental, Nightly, and Continuous, and Test can be Start, Update, "
"Build, Test, Coverage, and Submit."}, "Configure, Build, Test, Coverage, and Submit."},
{"-M <model>, --test-model <model>", "Sets the model for a dashboard", {"-M <model>, --test-model <model>", "Sets the model for a dashboard",
"This option tells ctest to act as a Dart client " "This option tells ctest to act as a Dart client "
"where the TestModel can be Experimental, " "where the TestModel can be Experimental, "
"Nightly, and Continuous. Combining -M and -T is similar to -D"}, "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 " "This option tells ctest to act as a Dart client "
"and perform some action such as start, build, test etc. " "and perform some action such as start, build, test etc. "
"Combining -M and -T is similar to -D"}, "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 " "This option tells ctest to load in a configuration script which sets "
"a number of parameters such as the binary and source directories. Then " "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 " "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 " "option basically sets up a dashboard and then runs ctest -D with the "
"appropriate options."}, "appropriate options."},
{"-A <file>, --add-notes <file>", "Add a notes file with submission", {"-A <file>, --add-notes <file>", "Add a notes file with submission",
"This option tells ctest to include a notes file when submitting dashboard. "}, "This option tells ctest to include a notes file when submitting "
{"-I [Start,End,Stride,test#,test#|Test file], --tests-information", "dashboard. "},
{"-I [Start,End,Stride,test#,test#|Test file], --tests-information",
"Run a specific number of tests by number.", "Run a specific number of tests by number.",
"This option causes ctest to run tests starting at number Start, ending " "This option causes ctest to run tests starting at number Start, ending "
"at number End, and incrementing by Stride. Any additional numbers after " "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 " "--test-command is specified then that will be run after the build is "
"complete. Other options that affect this mode are --build-target " "complete. Other options that affect this mode are --build-target "
"--build-nocmake, --build-run-dir, " "--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-noclean, --build-options"},
{"--build-target", "Specify a specific target to build.", {"--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." }, "This option goes with the --build-and-test option, if left out the all "
{"--build-nocmake", "Run the build without running cmake first.", "target is built." },
{"--build-nocmake", "Run the build without running cmake first.",
"Skip the cmake step." }, "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." }, "Directory where programs will be after it has been compiled." },
{"--build-two-config", "Run CMake twice", "" }, {"--build-two-config", "Run CMake twice", "" },
{"--build-exe-dir", "Specify the directory for the executable.", "" }, {"--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-project", "Specify the name of the project to build.", "" },
{"--build-makeprogram", "Specify the make program to use.", "" }, {"--build-makeprogram", "Specify the make program to use.", "" },
{"--build-noclean", "Skip the make clean step.", "" }, {"--build-noclean", "Skip the make clean step.", "" },
{"--build-options", "Add extra options to the build step.", {"--build-options", "Add extra options to the build step.",
"This option must be the last option with the exception of --test-command" }, "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.", "" }, {"--test-command", "The test to run with the --build-and-test option.", ""
{"--tomorrow-tag", "Nightly or experimental starts with next day tag.", },
{"--tomorrow-tag", "Nightly or experimental starts with next day tag.",
"This is useful if the build will not finish in one day." }, "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 " "This option tells CTest to use different initialization file instead of "
"DartConfiguration.tcl. This way multiple initialization files can be used " "DartConfiguration.tcl. This way multiple initialization files can be "
"for example to submit to multiple dashboards." }, "used for example to submit to multiple dashboards." },
{"--overwrite", "Overwrite CTest configuration option.", {"--overwrite", "Overwrite CTest configuration option.",
"By default ctest uses configuration options from configuration file. " "By default ctest uses configuration options from configuration file. "
"This option will overwrite the configuration option." }, "This option will overwrite the configuration option." },
@ -160,12 +170,12 @@ static const cmDocumentationEntry cmDocumentationOptions[] =
"This option will submit extra files to the dashboard." }, "This option will submit extra files to the dashboard." },
{"--force-new-ctest-process", "Run child CTest instances as new processes", {"--force-new-ctest-process", "Run child CTest instances as new processes",
"By default CTest will run child CTest instances within the same process. " "By default CTest will run child CTest instances within the same process. "
"If this behavior is not desired, this argument will enforce new processes " "If this behavior is not desired, this argument will enforce new "
"for child CTest processes." }, "processes for child CTest processes." },
{"--submit-index", "Submit individual dashboard tests with specific index", {"--submit-index", "Submit individual dashboard tests with specific index",
"This option allows performing the same CTest action (such as test) multiple " "This option allows performing the same CTest action (such as test) "
"times and submit all stages to the same dashboard (Dart2 required). " "multiple times and submit all stages to the same dashboard (Dart2 "
"Each execution requires different index." }, "required). Each execution requires different index." },
{0,0,0} {0,0,0}
}; };
@ -186,12 +196,13 @@ int main (int argc, char *argv[])
if ( cmSystemTools::GetCurrentWorkingDirectory().size() == 0 ) 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; nocwd = 1;
} }
// If there is a testing input file, check for documentation options // If there is a testing input file, check for documentation options
// only if there are actually arguments. We want running without // only if there are actually arguments. We want running without
// arguments to run tests. // arguments to run tests.
@ -200,7 +211,8 @@ int main (int argc, char *argv[])
{ {
if(argc == 1) if(argc == 1)
{ {
cmCTestLog(&inst, ERROR_MESSAGE, "*********************************" << std::endl cmCTestLog(&inst, ERROR_MESSAGE, "*********************************"
<< std::endl
<< "No test configuration file found!" << std::endl << "No test configuration file found!" << std::endl
<< "*********************************" << std::endl); << "*********************************" << std::endl);
} }
@ -221,8 +233,7 @@ int main (int argc, char *argv[])
#define cout no_cout_use_cmCTestLog #define cout no_cout_use_cmCTestLog
} }
} }
#ifdef _WIN32 #ifdef _WIN32
std::string comspec = "cmw9xcom.exe"; std::string comspec = "cmw9xcom.exe";
cmSystemTools::SetWindows9xComspecSubstitute(comspec.c_str()); cmSystemTools::SetWindows9xComspecSubstitute(comspec.c_str());