diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-01-30 16:17:36 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-01-30 16:17:36 (GMT) |
commit | c4093afc52967c987f0cd2947949899642db977b (patch) | |
tree | fc180b4f3276461339435fef3e47dbfead203932 | |
parent | 45d0dd13444a8f07d90004ca8ebefdc18498ed62 (diff) | |
download | CMake-c4093afc52967c987f0cd2947949899642db977b.zip CMake-c4093afc52967c987f0cd2947949899642db977b.tar.gz CMake-c4093afc52967c987f0cd2947949899642db977b.tar.bz2 |
ENH: enhancements for cdash, include system information and better time entries
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.cxx | 7 | ||||
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.h | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestConfigureHandler.cxx | 10 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 32 | ||||
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 5 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 4 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.h | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestUpdateHandler.cxx | 4 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 39 | ||||
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Source/kwsys/SystemInformation.hxx.in | 12 |
11 files changed, 105 insertions, 16 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 31b9adf..bb1d7ee 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -399,6 +399,7 @@ int cmCTestBuildHandler::ProcessHandler() // Remember start build time this->StartBuild = this->CTest->CurrentTime(); + this->StartBuildTime = cmSystemTools::GetTime(); int retVal = 0; int res = cmsysProcess_State_Exited; if ( !this->CTest->GetShowOnly() ) @@ -414,6 +415,7 @@ int cmCTestBuildHandler::ProcessHandler() // Remember end build time and calculate elapsed time this->EndBuild = this->CTest->CurrentTime(); + this->EndBuildTime = cmSystemTools::GetTime(); double elapsed_build_time = cmSystemTools::GetTime() - elapsed_time_start; if (res != cmsysProcess_State_Exited || retVal ) { @@ -483,6 +485,9 @@ void cmCTestBuildHandler::GenerateDartBuildOutput( this->CTest->StartXML(os); os << "<Build>\n" << "\t<StartDateTime>" << this->StartBuild << "</StartDateTime>\n" + << "\t<StartBuildTime>" << + static_cast<unsigned int>(this->StartBuildTime) + << "</StartBuildTime>\n" << "<BuildCommand>" << this->CTest->MakeXMLSafe( this->CTest->GetCTestConfiguration("MakeCommand")) @@ -586,6 +591,8 @@ void cmCTestBuildHandler::GenerateDartBuildOutput( } os << "\t<Log Encoding=\"base64\" Compression=\"/bin/gzip\">\n\t</Log>\n" << "\t<EndDateTime>" << this->EndBuild << "</EndDateTime>\n" + << "\t<EndBuildTime>" << static_cast<unsigned int>(this->EndBuildTime) + << "</EndBuildTime>\n" << "<ElapsedMinutes>" << static_cast<int>(elapsed_build_time/6)/10.0 << "</ElapsedMinutes>" << "</Build>" << std::endl; diff --git a/Source/CTest/cmCTestBuildHandler.h b/Source/CTest/cmCTestBuildHandler.h index e4f3f43..73d5a5a 100644 --- a/Source/CTest/cmCTestBuildHandler.h +++ b/Source/CTest/cmCTestBuildHandler.h @@ -91,6 +91,8 @@ private: std::string StartBuild; std::string EndBuild; + double StartBuildTime; + double EndBuildTime; std::vector<cmStdString> CustomErrorMatches; std::vector<cmStdString> CustomErrorExceptions; diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx index 1a67289..b81767b 100644 --- a/Source/CTest/cmCTestConfigureHandler.cxx +++ b/Source/CTest/cmCTestConfigureHandler.cxx @@ -74,6 +74,8 @@ int cmCTestConfigureHandler::ProcessHandler() return 1; } std::string start_time = this->CTest->CurrentTime(); + unsigned int start_time_time = static_cast<unsigned int>( + cmSystemTools::GetTime()); cmGeneratedFileStream ofs; this->StartLogFile("Configure", ofs); @@ -93,7 +95,10 @@ int cmCTestConfigureHandler::ProcessHandler() this->CTest->StartXML(os); os << "<Configure>\n" << "\t<StartDateTime>" << start_time << "</StartDateTime>" - << std::endl; + << std::endl + << "\t<StartConfigureTime>" << start_time_time + << "</StartConfigureTime>\n"; + if ( res == cmsysProcess_State_Exited && retVal ) { os << retVal; @@ -105,6 +110,9 @@ int cmCTestConfigureHandler::ProcessHandler() std::string end_time = this->CTest->CurrentTime(); os << "\t<ConfigureStatus>" << retVal << "</ConfigureStatus>\n" << "\t<EndDateTime>" << end_time << "</EndDateTime>\n" + << "\t<EndConfigureTime>" << + static_cast<unsigned int>(cmSystemTools::GetTime()) + << "</EndConfigureTime>\n" << "<ElapsedMinutes>" << static_cast<int>( (cmSystemTools::GetTime() - elapsed_time_start)/6)/10.0 diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index db1504c..5ef9e55 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -171,7 +171,10 @@ bool cmCTestCoverageHandler::StartCoverageLogFile( std::string local_start_time = this->CTest->CurrentTime(); this->CTest->StartXML(covLogFile); covLogFile << "<CoverageLog>" << std::endl - << "\t<StartDateTime>" << local_start_time << "</StartDateTime>" + << "\t<StartDateTime>" << local_start_time << "</StartDateTime>" + << "\t<StartTime>" + << static_cast<unsigned int>(cmSystemTools::GetTime()) + << "</StartTime>" << std::endl; return true; } @@ -182,6 +185,9 @@ void cmCTestCoverageHandler::EndCoverageLogFile(cmGeneratedFileStream& ostr, { std::string local_end_time = this->CTest->CurrentTime(); ostr << "\t<EndDateTime>" << local_end_time << "</EndDateTime>" << std::endl + << "\t<EndTime>" << + static_cast<unsigned int>(cmSystemTools::GetTime()) + << "</EndTime>" << std::endl << "</CoverageLog>" << std::endl; this->CTest->EndXML(ostr); char covLogFilename[1024]; @@ -304,7 +310,8 @@ int cmCTestCoverageHandler::ProcessHandler() } std::string coverage_start_time = this->CTest->CurrentTime(); - + unsigned int coverage_start_time_time = static_cast<unsigned int>( + cmSystemTools::GetTime()); std::string sourceDir = this->CTest->GetCTestConfiguration("SourceDirectory"); std::string binaryDir @@ -386,6 +393,8 @@ int cmCTestCoverageHandler::ProcessHandler() covSumFile << "<Coverage>" << std::endl << "\t<StartDateTime>" << coverage_start_time << "</StartDateTime>" + << std::endl + << "\t<StartTime>" << coverage_start_time_time << "</StartTime>" << std::endl; int logFileCount = 0; if ( !this->StartCoverageLogFile(covLogFile, logFileCount) ) @@ -577,7 +586,10 @@ int cmCTestCoverageHandler::ProcessHandler() covSumFile.setf(std::ios::fixed, std::ios::floatfield); covSumFile.precision(2); covSumFile << (percent_coverage)<< "</PercentCoverage>\n" - << "\t<EndDateTime>" << end_time << "</EndDateTime>\n"; + << "\t<EndDateTime>" << end_time << "</EndDateTime>\n" + << "\t<EndTime>" << + static_cast<unsigned int>(cmSystemTools::GetTime()) + << "</EndTime>\n"; covSumFile << "<ElapsedMinutes>" << static_cast<int>((cmSystemTools::GetTime() - elapsed_time_start)/6)/10.0 << "</ElapsedMinutes>" @@ -1410,6 +1422,10 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( covSumFile << "<Coverage>" << std::endl << "\t<StartDateTime>" << coverage_start_time << "</StartDateTime>" + << std::endl + << "\t<StartTime>" + << static_cast<unsigned int>(cmSystemTools::GetTime()) + << "</StartTime>" << std::endl; std::string stdline; std::string errline; @@ -1561,9 +1577,13 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( << "\t<PercentCoverage>"; covSumFile.setf(std::ios::fixed, std::ios::floatfield); covSumFile.precision(2); - covSumFile << SAFEDIV(percent_coverage,number_files)<< "</PercentCoverage>\n" - << "\t<EndDateTime>" << end_time << "</EndDateTime>\n"; - covSumFile << "<ElapsedMinutes>" << + covSumFile + << SAFEDIV(percent_coverage,number_files)<< "</PercentCoverage>\n" + << "\t<EndDateTime>" << end_time << "</EndDateTime>\n" + << "\t<EndTime>" << static_cast<unsigned int>(cmSystemTools::GetTime()) + << "</EndTime>\n"; + covSumFile + << "<ElapsedMinutes>" << static_cast<int>((cmSystemTools::GetTime() - elapsed_time_start)/6)/10.0 << "</ElapsedMinutes>" << "</Coverage>" << std::endl; diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 252c5b2..71832b5 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -306,7 +306,8 @@ void cmCTestMemCheckHandler::GenerateDartOutput(std::ostream& os) os << "\">" << std::endl; os << "\t<StartDateTime>" << this->StartTest << "</StartDateTime>\n" - << "\t<TestList>\n"; + << "\t<StartTestTime>" << this->StartTestTime << "</StartTestTime>\n" + << "\t<TestList>\n"; cmCTestMemCheckHandler::TestResultsVector::size_type cc; for ( cc = 0; cc < this->TestResults.size(); cc ++ ) { @@ -405,6 +406,8 @@ void cmCTestMemCheckHandler::GenerateDartOutput(std::ostream& os) os << "\t</DefectList>" << std::endl; os << "\t<EndDateTime>" << this->EndTest << "</EndDateTime>" << std::endl; + os << "\t<EndTestTime>" << this->EndTestTime + << "</EndTestTime>" << std::endl; os << "<ElapsedMinutes>" << static_cast<int>(this->ElapsedTestingTime/6)/10.0 << "</ElapsedMinutes>\n"; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index b01535f..90e5265 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -917,6 +917,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed, cmCTestTestHandler::ListOfTests::size_type tmsize = this->TestList.size(); this->StartTest = this->CTest->CurrentTime(); + this->StartTestTime = cmSystemTools::GetTime(); double elapsed_time_start = cmSystemTools::GetTime(); *this->LogFile << "Start testing: " << this->StartTest << std::endl @@ -999,6 +1000,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed, } this->EndTest = this->CTest->CurrentTime(); + this->EndTestTime = cmSystemTools::GetTime(); this->ElapsedTestingTime = cmSystemTools::GetTime() - elapsed_time_start; if ( this->LogFile ) { @@ -1023,6 +1025,7 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os) this->CTest->StartXML(os); os << "<Testing>\n" << "\t<StartDateTime>" << this->StartTest << "</StartDateTime>\n" + << "\t<StartTestTime>" << this->StartTestTime << "</StartTestTime>\n" << "\t<TestList>\n"; cmCTestTestHandler::TestResultsVector::size_type cc; for ( cc = 0; cc < this->TestResults.size(); cc ++ ) @@ -1110,6 +1113,7 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os) } os << "\t<EndDateTime>" << this->EndTest << "</EndDateTime>\n" + << "\t<EndTestTime>" << this->EndTestTime << "</EndTestTime>\n" << "<ElapsedMinutes>" << static_cast<int>(this->ElapsedTestingTime/6)/10.0 << "</ElapsedMinutes>" diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index a84e9fe..395ad3b 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -136,6 +136,8 @@ protected: std::vector<cmStdString> CustomTestsIgnore; std::string StartTest; std::string EndTest; + unsigned int StartTestTime; + unsigned int EndTestTime; bool MemCheck; int CustomMaximumPassedTestOutputSize; int CustomMaximumFailedTestOutputSize; diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index e47f967..a8afe12 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -541,6 +541,7 @@ int cmCTestUpdateHandler::ProcessHandler() return -1; } std::string start_time = this->CTest->CurrentTime(); + unsigned int start_time_time = cmSystemTools::GetTime(); double elapsed_time_start = cmSystemTools::GetTime(); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "* Update repository: " @@ -606,6 +607,7 @@ int cmCTestUpdateHandler::ProcessHandler() << "\t<BuildStamp>" << this->CTest->GetCurrentTag() << "-" << this->CTest->GetTestModelString() << "</BuildStamp>" << std::endl; os << "\t<StartDateTime>" << start_time << "</StartDateTime>\n" + << "\t<StartTime>" << start_time_time << "</StartTime>\n" << "\t<UpdateCommand>" << this->CTest->MakeXMLSafe(command) << "</UpdateCommand>\n" << "\t<UpdateType>" << this->CTest->MakeXMLSafe( @@ -1076,6 +1078,8 @@ int cmCTestUpdateHandler::ProcessHandler() cmCTestLog(this->CTest, DEBUG, "End" << std::endl); std::string end_time = this->CTest->CurrentTime(); os << "\t<EndDateTime>" << end_time << "</EndDateTime>\n" + << "\t<EndTime>" << static_cast<unsigned int>(cmSystemTools::GetTime()) + << "</EndTime>\n" << "<ElapsedMinutes>" << static_cast<int>((cmSystemTools::GetTime() - elapsed_time_start)/6)/10.0 << "</ElapsedMinutes>\n" diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index c6b71b6..b8d4034 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -22,6 +22,7 @@ #include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" #include <cmsys/Directory.hxx> +#include <cmsys/SystemInformation.hxx> #include "cmDynamicLoader.h" #include "cmGeneratedFileStream.h" #include "cmCTestCommand.h" @@ -1229,13 +1230,38 @@ void cmCTest::StartXML(std::ostream& ostr) " NightlStartTime was not set correctly." << std::endl); cmSystemTools::SetFatalErrorOccured(); } + // find out about the system + cmsys::SystemInformation info; + info.RunCPUCheck(); + info.RunOSCheck(); + info.RunMemoryCheck(); ostr << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" - << "<Site BuildName=\"" << this->GetCTestConfiguration("BuildName") - << "\" BuildStamp=\"" << this->CurrentTag << "-" - << this->GetTestModelString() << "\" Name=\"" - << this->GetCTestConfiguration("Site") << "\" Generator=\"ctest" - << cmVersion::GetCMakeVersion() - << "\">" << std::endl; + << "<Site BuildName=\"" << this->GetCTestConfiguration("BuildName") + << "\"\n\tBuildStamp=\"" << this->CurrentTag << "-" + << this->GetTestModelString() << "\"\n\tName=\"" + << this->GetCTestConfiguration("Site") << "\"\n\tGenerator=\"ctest" + << cmVersion::GetCMakeVersion() << "\"" + << "\tOSName=\"" << info.GetOSName() << "\"\n" + << "\tHostname=\"" << info.GetHostname() << "\"\n" + << "\tOSRelease=\"" << info.GetOSRelease() << "\"\n" + << "\tOSVersion=\"" << info.GetOSVersion() << "\"\n" + << "\tOSPlatform=\"" << info.GetOSPlatform() << "\"\n" + << "\tIs64Bits=\"" << info.Is64Bits() << "\"\n" + << "\tVendorString=\"" << info.GetVendorString() << "\"\n" + << "\tVendorID=\"" << info.GetVendorID() << "\"\n" + << "\tFamilyID=\"" << info.GetFamilyID() << "\"\n" + << "\tModelID=\"" << info.GetModelID() << "\"\n" + << "\tProcessorCacheSize=\"" << info.GetProcessorCacheSize() << "\"\n" + << "\tNumberOfLogicalCPU=\"" << info.GetNumberOfLogicalCPU() << "\"\n" + << "\tNumberOfPhysicalCPU=\""<< info.GetNumberOfPhysicalCPU() << "\"\n" + << "\tTotalVirtualMemory=\"" << info.GetTotalVirtualMemory() << "\"\n" + << "\tTotalPhysicalMemory=\""<< info.GetTotalPhysicalMemory() << "\"\n" + << "\tLogicalProcessorsPerPhysical=\"" + << info.GetLogicalProcessorsPerPhysical() << "\"\n" + << "\tProcessorClockFrequency=\"" + << info.GetProcessorClockFrequency() << "\"\n" + << ">" << std::endl; + ostr << "<SystemInformation junk=1.0></SystemInformation>\n"; } //---------------------------------------------------------------------- @@ -1266,6 +1292,7 @@ int cmCTest::GenerateCTestNotesOutput(std::ostream& os, cmCTestLog(this, OUTPUT, "\tAdd file: " << it->c_str() << std::endl); std::string note_time = this->CurrentTime(); os << "<Note Name=\"" << this->MakeXMLSafe(it->c_str()) << "\">\n" + << "<Time>" << cmSystemTools::GetTime() << "</Time>\n" << "<DateTime>" << note_time << "</DateTime>\n" << "<Text>" << std::endl; std::ifstream ifs(it->c_str()); diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index a2a438c..b13d061 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -137,9 +137,9 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) SET(KWSYS_USE_IOStream 1) SET(KWSYS_USE_DateStamp 1) SET(KWSYS_USE_String 1) -# SET(KWSYS_USE_SystemInformation 1) + SET(KWSYS_USE_SystemInformation 1) ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) - + # Setup the large file support default. IF(KWSYS_LFS_DISABLE) SET(KWSYS_LFS_REQUESTED 0) diff --git a/Source/kwsys/SystemInformation.hxx.in b/Source/kwsys/SystemInformation.hxx.in index 4894cca..36eb547 100644 --- a/Source/kwsys/SystemInformation.hxx.in +++ b/Source/kwsys/SystemInformation.hxx.in @@ -107,6 +107,11 @@ //# error "No Long long" #endif +/* Define these macros temporarily to keep the code readable. */ +#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# define kwsys_stl @KWSYS_NAMESPACE@_stl +# define kwsys_ios @KWSYS_NAMESPACE@_ios +#endif #include <@KWSYS_NAMESPACE@/stl/string> #include <@KWSYS_NAMESPACE@/stl/vector> @@ -294,4 +299,11 @@ protected: std::string OSPlatform; }; } // namespace @KWSYS_NAMESPACE@ + +/* Undefine temporary macros. */ +#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# undef kwsys_stl +# undef kwsys_ios +#endif + #endif |