Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Reporter

mattt edited this page Jan 8, 2021 · 2 revisions

Reporter

A class that reports the progress and outcomes of tests according to the Test Anything Protocol (TAP).

public final class Reporter

Initializers

init(version:numberOfTests:)

Creates a reporter with a given number of tests that writes to standard output (STDOUT).

public convenience init(version: Int = TAP.version, numberOfTests: Int)

Parameters

  • version: The TAP version (TAP.version by default).
  • numberOfTests: The number of tests expected to run. This should be a positive number or zero if the number of tests cannot be determined ahead of time.

init(version:numberOfTests:output:)

Creates a reporter with a given number of tests that writes to the specified output target.

public required init<Target: TextOutputStream>(version: Int = TAP.version, numberOfTests: Int, output: inout Target)

Parameters

  • version: The TAP version (TAP.version by default).
  • numberOfTests: The number of tests expected to run. This should be a positive number or zero if the number of tests cannot be determined ahead of time.
  • ouput: An output stream to receive the reported results.

Properties

output

The text output stream to which results are reported.

var output: TextOutputStream

Methods

report(_:)

Reports the output of a test.

public func report(_ outcome: Outcome)

Parameters

  • outcome: The test outcome.

report(_:)

Reports a "Bail out!" directive.

public func report(_ bailOut: BailOut)

Parameters

  • bailOut: The directive.