summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestTestMeasurementXMLParser.h
diff options
context:
space:
mode:
authorZack Galbreath <zack.galbreath@kitware.com>2021-07-01 16:40:41 (GMT)
committerZack Galbreath <zack.galbreath@kitware.com>2021-07-01 19:16:23 (GMT)
commit5489ce74b349ed31d6abb6ee5a0aaa17b10b474d (patch)
tree29ae508b56f972899af0c6ec482b6ef66d1f7f29 /Source/CTest/cmCTestTestMeasurementXMLParser.h
parent7817aa6fa4097a2c642ff1333be72f93a6e32ed1 (diff)
downloadCMake-5489ce74b349ed31d6abb6ee5a0aaa17b10b474d.zip
CMake-5489ce74b349ed31d6abb6ee5a0aaa17b10b474d.tar.gz
CMake-5489ce74b349ed31d6abb6ee5a0aaa17b10b474d.tar.bz2
ctest: support <CTestMeasurement> for runtime measurements
Teach CTest to parse output for <CTestMeasurement> in addition to <DartMeasurement> for measurements defined at runtime. Use a new class (cmCTestTestMeasurementXMLParser) derived from cmXMLParser to parse the data and attributes these XML elements. This is an improvement over our previous approach of using a series of regular expressions. As part of this commit we also rename some member variables and methods to make their purpose more clear. DartStuff -> AllTestMeasurementsRegex DartStuff1 -> SingleTestMeasurementRegex DartString -> TestMeasurementsOutput GenerateDartOutput() -> GenerateCTestXML() GenerateRegressionImages() -> RecordCustomTestMeasurements() cmCTestRunTest::DartProcessing() -> ParseOutputForMeasurements()
Diffstat (limited to 'Source/CTest/cmCTestTestMeasurementXMLParser.h')
-rw-r--r--Source/CTest/cmCTestTestMeasurementXMLParser.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestTestMeasurementXMLParser.h b/Source/CTest/cmCTestTestMeasurementXMLParser.h
new file mode 100644
index 0000000..b2c3eb3
--- /dev/null
+++ b/Source/CTest/cmCTestTestMeasurementXMLParser.h
@@ -0,0 +1,21 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+
+#include <string>
+
+#include "cmXMLParser.h"
+
+class cmCTestTestMeasurementXMLParser : public cmXMLParser
+{
+public:
+ cmCTestTestMeasurementXMLParser() {}
+ std::string CharacterData;
+ std::string ElementName;
+ std::string MeasurementName;
+ std::string MeasurementType;
+
+protected:
+ void StartElement(const std::string& name, const char** atts) override;
+ void EndElement(const std::string& /*name*/) override {}
+ void CharacterDataHandler(const char* data, int length) override;
+};