diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-06-10 13:01:37 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-06-10 13:01:37 (GMT) |
commit | ab313ca5476f7ab56da7b03f1355c3d0d1b81866 (patch) | |
tree | ea211281fe61ce16a4918d1ff4aeff60106b1bd4 | |
parent | cf4ed391407370ff4148ea286ebf9360b9e7331f (diff) | |
download | CMake-ab313ca5476f7ab56da7b03f1355c3d0d1b81866.zip CMake-ab313ca5476f7ab56da7b03f1355c3d0d1b81866.tar.gz CMake-ab313ca5476f7ab56da7b03f1355c3d0d1b81866.tar.bz2 |
ENH: Be more verbose
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.cxx | 10 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 26 |
2 files changed, 30 insertions, 6 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index ce43bec..ca9d54b 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -500,13 +500,13 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, } argv.push_back(0); - cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Run command:"); + cmCTestLog(m_CTest, HANDLER_VERBOSE_OUTPUT, "Run command:"); std::vector<const char*>::iterator ait; - for ( ait = argv.begin(); ait != argv.end(); ++ ait ) + for ( ait = argv.begin(); ait != argv.end() && *ait; ++ ait ) { - cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, " \"" << *ait << "\""); + cmCTestLog(m_CTest, HANDLER_VERBOSE_OUTPUT, " \"" << *ait << "\""); } - cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, std::endl); + cmCTestLog(m_CTest, HANDLER_VERBOSE_OUTPUT, std::endl); // Now create process object cmsysProcess* cp = cmsysProcess_New(); @@ -589,7 +589,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, errorwarning.m_Error = true; m_ErrorsAndWarnings.push_back(errorwarning); m_TotalErrors ++; - cmCTestLog(this, ERROR_MESSAGE, "There was an error: " << cmsysProcess_GetErrorString(cp) << std::endl); + cmCTestLog(m_CTest, ERROR_MESSAGE, "There was an error: " << cmsysProcess_GetErrorString(cp) << std::endl); } cmsysProcess_Delete(cp); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 9f6d77a..5f72a06 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -753,10 +753,16 @@ int cmCTest::GetTestModelFromString(const char* str) return cmCTest::EXPERIMENTAL; } +//###################################################################### +//###################################################################### +//###################################################################### +//###################################################################### + //---------------------------------------------------------------------- int cmCTest::RunMakeCommand(const char* command, std::string* output, int* retVal, const char* dir, int timeout, std::ofstream& ofs) { + // First generate the command and arguments std::vector<cmStdString> args = cmSystemTools::ParseArguments(command); if(args.size() < 1) @@ -777,6 +783,15 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output, *output = ""; } + cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Run command:"); + std::vector<const char*>::iterator ait; + for ( ait = argv.begin(); ait != argv.end() && *ait; ++ ait ) + { + 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()); cmsysProcess_SetWorkingDirectory(cp, dir); @@ -784,13 +799,15 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output, cmsysProcess_SetTimeout(cp, timeout); cmsysProcess_Execute(cp); + // Initialize tick's std::string::size_type tick = 0; std::string::size_type tick_len = 1024; std::string::size_type tick_line_len = 50; char* data; int length; - cmCTestLog(this, HANDLER_OUTPUT, " Each . represents " << tick_len << " bytes of output" << std::endl + cmCTestLog(this, HANDLER_OUTPUT, + " Each . represents " << tick_len << " bytes of output" << std::endl << " " << std::flush); while(cmsysProcess_WaitForData(cp, &data, &length, 0)) { @@ -833,6 +850,7 @@ 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); } else if(result == cmsysProcess_State_Exception) { @@ -847,6 +865,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output, { *output += "\n*** ERROR executing: "; *output += cmsysProcess_GetErrorString(cp); + cmCTestLog(this, ERROR_MESSAGE, "There was an error: " << cmsysProcess_GetErrorString(cp) << std::endl); } cmsysProcess_Delete(cp); @@ -854,6 +873,11 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output, return result; } +//###################################################################### +//###################################################################### +//###################################################################### +//###################################################################### + //---------------------------------------------------------------------- int cmCTest::RunTest(std::vector<const char*> argv, std::string* output, int *retVal, |