[cmake-commits] andy committed cmCTestTestHandler.cxx 1.48 1.49 cmCTestTestHandler.h 1.18 1.19

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Oct 13 09:30:36 EDT 2006


Update of /cvsroot/CMake/CMake/Source/CTest
In directory public:/mounts/ram/cvs-serv11508/Source/CTest

Modified Files:
	cmCTestTestHandler.cxx cmCTestTestHandler.h 
Log Message:
ENH: Report command line as a measurement and allow user to add custom measurements


Index: cmCTestTestHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestTestHandler.cxx,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- cmCTestTestHandler.cxx	5 Oct 2006 21:53:09 -0000	1.48
+++ cmCTestTestHandler.cxx	13 Oct 2006 13:30:30 -0000	1.49
@@ -608,6 +608,7 @@
     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 +1002,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 +1650,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: cmCTestTestHandler.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestTestHandler.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- cmCTestTestHandler.h	16 Mar 2006 16:34:58 -0000	1.18
+++ cmCTestTestHandler.h	13 Oct 2006 13:30:31 -0000	1.19
@@ -73,20 +73,6 @@
    */
   bool SetTestsProperties(const std::vector<std::string>& args);
 
-  struct cmCTestTestResult
-  {
-    std::string Name;
-    std::string Path;
-    std::string FullCommandLine;
-    double      ExecutionTime;
-    int         ReturnValue;
-    int         Status;
-    std::string CompletionStatus;
-    std::string Output;
-    std::string RegressionImages;
-    int         TestCount;
-  };
-
   void Initialize();
 
 protected:
@@ -97,10 +83,26 @@
     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;
+    std::string Path;
+    std::string FullCommandLine;
+    double      ExecutionTime;
+    int         ReturnValue;
+    int         Status;
+    std::string CompletionStatus;
+    std::string Output;
+    std::string RegressionImages;
+    int         TestCount;
+    cmCTestTestProperties* Properties;
+  };
+
 
   virtual int PreProcessHandler();
   virtual int PostProcessHandler();



More information about the Cmake-commits mailing list