current

    The test case that is running on the current task, if any.

    Runner.RuntimeState.swift:206
    static var current: `Self`? { get }

    If the current task is running a test, or is a subtask of another task that is running a test, the value of this property describes the test’s currently-running case. If no test is currently running, the value of this property is nil.

    If the current task is detached from a task that started running a test, or if the current thread was created without using Swift concurrency (e.g. by using Thread.detachNewThread(_:) or DispatchQueue.async(execute:)), the value of this property may be nil.

    Other members in extension

    Types

    Show system interfaces (2)

    Hide system interfaces

    • struct Argument

      A type representing an argument passed to a parameter of a parameterized test function.

    • struct ID

      The ID of a test case.

    Instance members

    Show system interfaces (2)

    Hide system interfaces