[cmake-commits] hoffman committed cmCTestBuildHandler.cxx 1.42.2.4
1.42.2.5 cmCTestCoverageHandler.cxx 1.31.2.1 1.31.2.2
cmCTestMemCheckHandler.cxx 1.12 1.12.2.1
cmCTestScriptHandler.cxx 1.31.2.4 1.31.2.5
cmCTestScriptHandler.h 1.16.2.1 1.16.2.2
cmCTestSubmitHandler.cxx 1.23.2.1 1.23.2.2
cmCTestTestHandler.cxx 1.41.2.4 1.41.2.5 cmCTestTestHandler.h
1.18 1.18.2.1 cmCTestUpdateHandler.cxx 1.35 1.35.2.1
cmake-commits at cmake.org
cmake-commits at cmake.org
Fri Oct 27 16:01:52 EDT 2006
Update of /cvsroot/CMake/CMake/Source/CTest
In directory public:/mounts/ram/cvs-serv22632/Source/CTest
Modified Files:
Tag: CMake-2-4
cmCTestBuildHandler.cxx cmCTestCoverageHandler.cxx
cmCTestMemCheckHandler.cxx cmCTestScriptHandler.cxx
cmCTestScriptHandler.h cmCTestSubmitHandler.cxx
cmCTestTestHandler.cxx cmCTestTestHandler.h
cmCTestUpdateHandler.cxx
Log Message:
ENH: move changes from main tree
Index: cmCTestScriptHandler.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestScriptHandler.h,v
retrieving revision 1.16.2.1
retrieving revision 1.16.2.2
diff -u -d -r1.16.2.1 -r1.16.2.2
--- cmCTestScriptHandler.h 30 Apr 2006 14:59:20 -0000 1.16.2.1
+++ cmCTestScriptHandler.h 27 Oct 2006 20:01:49 -0000 1.16.2.2
@@ -96,6 +96,13 @@
static void SleepInSeconds(unsigned int secondsToWait);
void UpdateElapsedTime();
+ /**
+ * Return the time remaianing that the script is allowed to run in
+ * seconds if the user has set the variable CTEST_TIME_LIMIT. If that has
+ * not been set it returns 1e7 seconds
+ */
+ double GetRemainingTimeAllowed();
+
cmCTestScriptHandler();
~cmCTestScriptHandler();
Index: cmCTestSubmitHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestSubmitHandler.cxx,v
retrieving revision 1.23.2.1
retrieving revision 1.23.2.2
diff -u -d -r1.23.2.1 -r1.23.2.2
--- cmCTestSubmitHandler.cxx 29 Apr 2006 15:49:20 -0000 1.23.2.1
+++ cmCTestSubmitHandler.cxx 27 Oct 2006 20:01:49 -0000 1.23.2.2
@@ -25,11 +25,10 @@
#include <cmsys/Base64.h>
// For XML-RPC submission
-#include "xmlrpc.h"
-#include "xmlrpc_client.h"
+#include "cm_xmlrpc.h"
// For curl submission
-#include "cmcurl/curl/curl.h"
+#include "cm_curl.h"
#include <sys/stat.h>
@@ -644,12 +643,14 @@
const cmStdString& url)
{
xmlrpc_env env;
- std::string ctestVersion = cmVersion::GetCMakeVersion();
+ char ctestString[] = "CTest";
+ std::string ctestVersionString = cmVersion::GetCMakeVersion();
+ char* ctestVersion = const_cast<char*>(ctestVersionString.c_str());
cmStdString realURL = url + "/" + remoteprefix + "/Command/";
/* Start up our XML-RPC client library. */
- xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, "CTest", ctestVersion.c_str());
+ xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, ctestString, ctestVersion);
/* Initialize our error-handling environment. */
xmlrpc_env_init(&env);
@@ -697,9 +698,9 @@
}
fclose(fp);
- std::string remoteCommand = "Submit.put";
- result = xmlrpc_client_call(&env, realURL.c_str(),
- remoteCommand.c_str(),
+ char remoteCommand[] = "Submit.put";
+ char* pRealURL = const_cast<char*>(realURL.c_str());
+ result = xmlrpc_client_call(&env, pRealURL, remoteCommand,
"(6)", fileBuffer, (xmlrpc_int32)fileSize );
delete [] fileBuffer;
Index: cmCTestMemCheckHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestMemCheckHandler.cxx,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -u -d -r1.12 -r1.12.2.1
--- cmCTestMemCheckHandler.cxx 30 Mar 2006 18:49:56 -0000 1.12
+++ cmCTestMemCheckHandler.cxx 27 Oct 2006 20:01:49 -0000 1.12.2.1
@@ -334,7 +334,7 @@
}
else
{
- cmCTestLog(this->CTest, ERROR_MESSAGE,
+ cmCTestLog(this->CTest, WARNING,
"Memory checker (MemoryCheckCommand) "
"not set, or cannot find the specified program."
<< std::endl);
Index: cmCTestScriptHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestScriptHandler.cxx,v
retrieving revision 1.31.2.4
retrieving revision 1.31.2.5
diff -u -d -r1.31.2.4 -r1.31.2.5
--- cmCTestScriptHandler.cxx 13 Oct 2006 14:52:07 -0000 1.31.2.4
+++ cmCTestScriptHandler.cxx 27 Oct 2006 20:01:49 -0000 1.31.2.5
@@ -364,7 +364,8 @@
this->Makefile->AddFunctionBlocker(f);
// finally read in the script
- if (!this->Makefile->ReadListFile(0, script.c_str()))
+ if (!this->Makefile->ReadListFile(0, script.c_str()) ||
+ cmSystemTools::GetErrorOccuredFlag())
{
return 2;
}
@@ -964,3 +965,24 @@
}
return true;
}
+
+//-------------------------------------------------------------------------
+double cmCTestScriptHandler::GetRemainingTimeAllowed()
+{
+ if (!this->Makefile)
+ {
+ return 1.0e7;
+ }
+
+ const char *timelimitS
+ = this->Makefile->GetDefinition("CTEST_TIME_LIMIT");
+
+ if (!timelimitS)
+ {
+ return 1.0e7;
+ }
+
+ double timelimit = atof(timelimitS);
+
+ return timelimit - cmSystemTools::GetTime() + this->ScriptStartTime;
+}
Index: cmCTestTestHandler.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestTestHandler.h,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -u -d -r1.18 -r1.18.2.1
--- cmCTestTestHandler.h 16 Mar 2006 16:34:58 -0000 1.18
+++ cmCTestTestHandler.h 27 Oct 2006 20:01:50 -0000 1.18.2.1
@@ -73,6 +73,20 @@
*/
bool SetTestsProperties(const std::vector<std::string>& args);
+ void Initialize();
+
+ struct cmCTestTestProperties
+ {
+ cmStdString Name;
+ cmStdString Directory;
+ std::vector<std::string> Args;
+ std::vector<cmsys::RegularExpression> ErrorRegularExpressions;
+ std::vector<cmsys::RegularExpression> RequiredRegularExpressions;
+ std::map<cmStdString, cmStdString> Measurements;
+ bool IsInBasedOnREOptions;
+ bool WillFail;
+ };
+
struct cmCTestTestResult
{
std::string Name;
@@ -85,23 +99,10 @@
std::string Output;
std::string RegressionImages;
int TestCount;
+ cmCTestTestProperties* Properties;
};
- void Initialize();
-
protected:
- struct cmCTestTestProperties
- {
- cmStdString Name;
- cmStdString Directory;
- std::vector<std::string> Args;
- std::vector<cmsys::RegularExpression> ErrorRegularExpressions;
- std::vector<cmsys::RegularExpression> RequiredRegularExpressions;
- bool IsInBasedOnREOptions;
- bool WillFail;
- };
-
-
virtual int PreProcessHandler();
virtual int PostProcessHandler();
virtual void GenerateTestCommand(std::vector<const char*>& args);
Index: cmCTestCoverageHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestCoverageHandler.cxx,v
retrieving revision 1.31.2.1
retrieving revision 1.31.2.2
diff -u -d -r1.31.2.1 -r1.31.2.2
--- cmCTestCoverageHandler.cxx 13 Oct 2006 14:52:07 -0000 1.31.2.1
+++ cmCTestCoverageHandler.cxx 27 Oct 2006 20:01:49 -0000 1.31.2.2
@@ -180,6 +180,12 @@
{
int error = 0;
+ // do we have time for this
+ if (this->CTest->GetRemainingTimeAllowed() < 120)
+ {
+ return error;
+ }
+
std::string sourceDir
= this->CTest->GetCTestConfiguration("SourceDirectory");
std::string binaryDir
@@ -251,7 +257,8 @@
if ( files.size() == 0 )
{
- cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot find any coverage files."
+ cmCTestLog(this->CTest, WARNING,
+ " Cannot find any coverage files. Ignoring Coverage request."
<< std::endl);
// No coverage files is a valid thing, so the exit code is 0
cmSystemTools::ChangeDirectory(currentDirectory.c_str());
@@ -710,7 +717,8 @@
std::string line;
for ( cc= 0; cc < fcov.size(); cc ++ )
{
- if ( !cmSystemTools::GetLineFromStream(ifs, line) )
+ if ( !cmSystemTools::GetLineFromStream(ifs, line) &&
+ cc != fcov.size() -1 )
{
cmOStringStream ostr;
ostr << "Problem reading source file: " << fullFileName.c_str()
Index: cmCTestUpdateHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestUpdateHandler.cxx,v
retrieving revision 1.35
retrieving revision 1.35.2.1
diff -u -d -r1.35 -r1.35.2.1
--- cmCTestUpdateHandler.cxx 15 Mar 2006 14:23:35 -0000 1.35
+++ cmCTestUpdateHandler.cxx 27 Oct 2006 20:01:50 -0000 1.35.2.1
@@ -278,7 +278,7 @@
if ( initialCheckoutCommand )
{
cmCTestLog(this->CTest, HANDLER_OUTPUT,
- " First perform the initil checkout: " << initialCheckoutCommand
+ " First perform the initial checkout: " << initialCheckoutCommand
<< std::endl);
cmStdString parent = cmSystemTools::GetParentDirectory(sourceDirectory);
if ( parent.empty() )
@@ -744,7 +744,7 @@
ofs << output << std::endl;
}
}
- if ( res && retVal == 0)
+ if ( res )
{
cmCTestLog(this->CTest, DEBUG, output << std::endl);
std::string::size_type sline = 0;
@@ -1090,7 +1090,7 @@
os << "</UpdateReturnStatus>" << std::endl;
os << "</Update>" << std::endl;
- if (! res || retVal )
+ if (! res )
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Error(s) when updating the project" << std::endl);
Index: cmCTestTestHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestTestHandler.cxx,v
retrieving revision 1.41.2.4
retrieving revision 1.41.2.5
diff -u -d -r1.41.2.4 -r1.41.2.5
--- cmCTestTestHandler.cxx 13 Oct 2006 14:52:07 -0000 1.41.2.4
+++ cmCTestTestHandler.cxx 27 Oct 2006 20:01:49 -0000 1.41.2.5
@@ -605,9 +605,18 @@
{
inREcnt++;
}
+
+ // if we are out of time then skip this test, we leave two minutes
+ // to submit results
+ if (this->CTest->GetRemainingTimeAllowed() - 120 <= 0)
+ {
+ continue;
+ }
+
const std::string& testname = it->Name;
std::vector<std::string>& args = it->Args;
cmCTestTestResult cres;
+ cres.Properties = &*it;
cres.ExecutionTime = 0;
cres.ReturnValue = -1;
cres.Status = cmCTestTestHandler::NOT_RUN;
@@ -1001,6 +1010,20 @@
<< result->CompletionStatus << "</Value></NamedMeasurement>\n";
}
os
+ << "\t\t\t<NamedMeasurement type=\"text/string\" "
+ << "name=\"Command Line\"><Value>"
+ << result->FullCommandLine << "</Value></NamedMeasurement>\n";
+ std::map<cmStdString,cmStdString>::iterator measureIt;
+ for ( measureIt = result->Properties->Measurements.begin();
+ measureIt != result->Properties->Measurements.end();
+ ++ measureIt )
+ {
+ os
+ << "\t\t\t<NamedMeasurement type=\"text/string\" "
+ << "name=\"" << measureIt->first.c_str() << "\"><Value>"
+ << measureIt->second.c_str() << "</Value></NamedMeasurement>\n";
+ }
+ os
<< "\t\t\t<Measurement>\n"
<< "\t\t\t\t<Value>";
os << cmCTest::MakeXMLSafe(result->Output);
@@ -1635,6 +1658,20 @@
cmsys::RegularExpression(crit->c_str()));
}
}
+ if ( key == "MEASUREMENT" )
+ {
+ size_t pos = val.find_first_of("=");
+ if ( pos != val.npos )
+ {
+ std::string mKey = val.substr(0, pos);
+ const char* mVal = val.c_str() + pos + 1;
+ rtit->Measurements[mKey] = mVal;
+ }
+ else
+ {
+ rtit->Measurements[val] = "1";
+ }
+ }
if ( key == "PASS_REGULAR_EXPRESSION" )
{
std::vector<std::string> lval;
Index: cmCTestBuildHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestBuildHandler.cxx,v
retrieving revision 1.42.2.4
retrieving revision 1.42.2.5
diff -u -d -r1.42.2.4 -r1.42.2.5
--- cmCTestBuildHandler.cxx 13 Oct 2006 14:52:07 -0000 1.42.2.4
+++ cmCTestBuildHandler.cxx 27 Oct 2006 20:01:49 -0000 1.42.2.5
@@ -99,6 +99,7 @@
"candidates are:",
": warning",
": \\(Warning\\)",
+ ": note",
"makefile:",
"Makefile:",
":[ \\t]+Where:",
@@ -109,6 +110,7 @@
static const char* cmCTestWarningMatches[] = {
"([^ :]+):([0-9]+): warning:",
+ "([^ :]+):([0-9]+): note:",
"^cc[^C]*CC: WARNING File = ([^,]+), Line = ([0-9]+)",
"^ld([^:])*:([ \\t])*WARNING([^:])*:",
"([^:]+): warning ([0-9]+):",
@@ -248,6 +250,12 @@
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, "Build project" << std::endl);
+ // do we have time for this
+ if (this->CTest->GetRemainingTimeAllowed() < 120)
+ {
+ return 0;
+ }
+
int entry;
for ( entry = 0;
cmCTestWarningErrorFileLine[entry].RegularExpressionString;
More information about the Cmake-commits
mailing list