CMake/Source/CTest/cmCTestTestMeasurementXMLParser.h
Zack Galbreath 5489ce74b3 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()
2021-07-01 15:16:23 -04:00

22 lines
636 B
C++

/* 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;
};