Fix invalid XCTestMeasurementParserMetric

This commit is contained in:
Stefan Ceriu
2022-08-23 09:07:59 +03:00
parent 3e078e7bbf
commit 31a9307b3e
@@ -40,14 +40,14 @@ class TestMeasurementParser {
do { do {
let pattern = """ let pattern = """
\\[(\ \\[(\
\(XCTestMeasurementParserMetric.appLaunch.regexValue)|\ \(TestMeasurementParserMetric.appLaunch.regexValue)|\
\(XCTestMeasurementParserMetric.clockMonotonicTime.regexValue)|\ \(TestMeasurementParserMetric.clockMonotonicTime.regexValue)|\
\(XCTestMeasurementParserMetric.cpuTime.regexValue)|\ \(TestMeasurementParserMetric.cpuTime.regexValue)|\
\(XCTestMeasurementParserMetric.memoryPeakPhysical.regexValue)|\ \(TestMeasurementParserMetric.memoryPeakPhysical.regexValue)|\
\(XCTestMeasurementParserMetric.memoryPhysical.regexValue)|\ \(TestMeasurementParserMetric.memoryPhysical.regexValue)|\
\(XCTestMeasurementParserMetric.cpuInstructionsRetired.regexValue)|\ \(TestMeasurementParserMetric.cpuInstructionsRetired.regexValue)|\
\(XCTestMeasurementParserMetric.diskLogicalWrites.regexValue)|\ \(TestMeasurementParserMetric.diskLogicalWrites.regexValue)|\
\(XCTestMeasurementParserMetric.cpuCycles.regexValue)\ \(TestMeasurementParserMetric.cpuCycles.regexValue)\
), \ ), \
(s|kB|kI|kC)\\] \ (s|kB|kI|kC)\\] \
average: ([0-9\\.]*), average: ([0-9\\.]*),
@@ -114,7 +114,7 @@ class TestMeasurementParser {
/// Retrieve the recorded average value for a particular metric /// Retrieve the recorded average value for a particular metric
/// - Parameter metric: Needs to match one of the metrics passed in the XCTest measure metrics array /// - Parameter metric: Needs to match one of the metrics passed in the XCTest measure metrics array
/// - Returns: The resulting average value /// - Returns: The resulting average value
func valueForMetric(_ metric: XCTestMeasurementParserMetric) -> Double? { func valueForMetric(_ metric: TestMeasurementParserMetric) -> Double? {
results[metric.rawValue] results[metric.rawValue]
} }
} }