Skip to content

Commit 1bb2e9e

Browse files
committed
Add doc comments to PerformanceMeterDelegate
1 parent ed70842 commit 1bb2e9e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Sources/XCTest/PerformanceMeter.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,28 @@ internal protocol PerformanceMetric {
3939
func failureMessage() -> String?
4040
}
4141

42+
/// Protocol used by `PerformanceMeter` to report measurement results
4243
internal protocol PerformanceMeterDelegate {
44+
/// Reports a string representation of the gathered performance metrics
45+
/// - Parameter results: The raw measured values, and some derived data such
46+
/// as average, and standard deviation
47+
/// - Parameter file: The source file name where the measurement was invoked
48+
/// - Parameter line: The source line number where the measurement was invoked
4349
func recordMeasurements(results: String, file: StaticString, line: UInt)
50+
51+
/// Reports a test failure from the analysis of performance measurements.
52+
/// This can currently be caused by an unexpectedly large standard deviation
53+
/// calculated over the data.
54+
/// - Parameter description: An explanation of the failure
55+
/// - Parameter file: The source file name where the measurement was invoked
56+
/// - Parameter line: The source line number where the measurement was invoked
4457
func recordFailure(description: String, file: StaticString, line: UInt)
58+
59+
/// Reports a misuse of the `PerformanceMeter` API, such as calling `
60+
/// startMeasuring` multiple times.
61+
/// - Parameter description: An explanation of the misuse
62+
/// - Parameter file: The source file name where the misuse occurred
63+
/// - Parameter line: The source line number where the misuse occurred
4564
func recordAPIViolation(description: String, file: StaticString, line: UInt)
4665
}
4766

0 commit comments

Comments
 (0)