Classes
The following classes are available globally.
-
Declaration
Swift
open class XCTMeasureOptions : XCTest.XCTMeasureOptions
-
A metric to record information about CPU activity during a performance test.
See moreXCTCPUMetric
is a wrapper toXCTest.XCTCPUMetric
.Declaration
Swift
public class XCTCPUMetric : XCTest.XCTCPUMetric, XCTMetric
-
A metric to record the time that elapses during a performance test.
See moreXCTClockMetric
is a wrapper toXCTest.XCTClockMetric
.Declaration
Swift
public class XCTClockMetric : XCTest.XCTClockMetric, XCTMetric
-
A metric to record the physical memory that a performance test uses.
See moreXCTMemoryMetric
is a wrapper toXCTest.XCTMemoryMetric
.Declaration
Swift
public class XCTMemoryMetric : XCTest.XCTMemoryMetric, XCTMetric
-
A metric to record the amount of data that a performance test logically writes to storage.
See moreXCTStorageMetric
is a wrapper toXCTest.XCTStorageMetric
.Declaration
Swift
public class XCTStorageMetric : XCTest.XCTStorageMetric, XCTMetric
-
The primary class to define tests in XCTBeton.
Extends the capabilities of
XCTestCase
withmeasure(metrics:options:block:)
andXCTAssertMetric(_:_:_:_:file:line:)
. You can use these features if you want to write performance tests with assertions.The following example shows how you can write a simple assertion:
See moreimport XCTBeton class PerformanceTests: XCTestCase { func test_measureSum() { measure { let _ = (1..<1000).reduce(0, +) } XCTAssertMetric(.clock, .timeMonotonic, .average(maximum: 0.001)) } }
Declaration
Swift
open class XCTestCase : XCTest.XCTestCase