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.

    XCTCPUMetric is a wrapper to XCTest.XCTCPUMetric.

    See more

    Declaration

    Swift

    public class XCTCPUMetric : XCTest.XCTCPUMetric, XCTMetric
  • A metric to record the time that elapses during a performance test.

    XCTClockMetric is a wrapper to XCTest.XCTClockMetric.

    See more

    Declaration

    Swift

    public class XCTClockMetric : XCTest.XCTClockMetric, XCTMetric
  • A metric to record the physical memory that a performance test uses.

    XCTMemoryMetric is a wrapper to XCTest.XCTMemoryMetric.

    See more

    Declaration

    Swift

    public class XCTMemoryMetric : XCTest.XCTMemoryMetric, XCTMetric
  • A metric to record the amount of data that a performance test logically writes to storage.

    XCTStorageMetric is a wrapper to XCTest.XCTStorageMetric.

    See more

    Declaration

    Swift

    public class XCTStorageMetric : XCTest.XCTStorageMetric, XCTMetric
  • The primary class to define tests in XCTBeton.

    Extends the capabilities of XCTestCase with measure(metrics:options:block:) and XCTAssertMetric(_:_:_:_: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:

    import XCTBeton
    
    class PerformanceTests: XCTestCase {
      func test_measureSum() {
        measure {
          let _ = (1..<1000).reduce(0, +)
        }
        XCTAssertMetric(.clock, .timeMonotonic, .average(maximum: 0.001))
      }
    }
    
    See more

    Declaration

    Swift

    open class XCTestCase : XCTest.XCTestCase