Contents

testSuite(_:didFailWithDescription:inFile:atLine:)

Notifies the observer when a test suite reports a failure.

Declaration

optional func testSuite(_ testSuite: XCTestSuite, didFailWithDescription description: String, inFile filePath: String?, atLine lineNumber: Int)

Parameters

  • testSuite:

    The test suite that failed. Additional information about the suite can be retrieved from the test suite’s associated Xctestrun.

  • description:

    A textual description of the failure.

  • filePath:

    The path to the file in the failure occurred, or nil if the file path is unknown.

  • lineNumber:

    The line number on which the failure was reported.

Discussion

Suite failures are most commonly reported during suite-level setup and teardown. Failures during tests are reported for the test case alone and are not reported as suite failures.

See Also

Observation Methods