Instance Propertyswift-testing 6.0.2Testing
timeLimit
The maximum amount of time the cases of this test may run for.
TimeLimitTrait.swift:197- iOS
- 16.0+
- macOS
- 13.0+
- tvOS
- 16.0+
- watchOS
- 9.0+
var timeLimit: Duration? { get }
Time limits are associated with tests using this trait:
Trait/timeLimit(_:)
If a test has more than one time limit associated with it, the value of this property is the shortest one. If a test has no time limits associated with it, the value of this property is nil
.
Other members in extension
Types
struct Case
A single test case from a parameterized
Test
.struct ID
Show system interfaces (2)
Hide system interfaces
struct Clock
A clock used to track time when events occur during testing.
struct Parameter
A type representing a single parameter to a parameterized test function.
Typealiases
Show implementation details (1)
Hide implementation details
typealias __Parameter
Information about a parameter to a test function.
Type members
static var current: `Self`?
The test that is running on the current task, if any.
static func == (lhs: Test, rhs: Test
) -> Bool
Show implementation details (7)
Hide implementation details
static func __function<C1, C2>(named: String, in: Any.Type?, xcTestCompatibleSelector: __XCTestCompatibleSelector?, displayName: String?, traits: [any TestTrait], arguments: @escaping () async throws -> C1, @escaping () async throws -> C2, sourceLocation: SourceLocation, parameters: [__Parameter], testFunction: @escaping (C1.Element, C2.Element) async throws -> Void
) -> Test Create an instance of
Test
for a parameterized function.static func __function<Key, Value>(named: String, in: Any.Type?, xcTestCompatibleSelector: __XCTestCompatibleSelector?, displayName: String?, traits: [any TestTrait], arguments: @escaping () async throws -> Dictionary<Key, Value>, sourceLocation: SourceLocation, parameters: [__Parameter], testFunction: @escaping ((Key, Value)) async throws -> Void
) -> Test Create an instance of
Test
for a parameterized function.static func __function<C1, C2>(named: String, in: Any.Type?, xcTestCompatibleSelector: __XCTestCompatibleSelector?, displayName: String?, traits: [any TestTrait], arguments: @escaping () async throws -> Zip2Sequence<C1, C2>, sourceLocation: SourceLocation, parameters: [__Parameter], testFunction: @escaping (C1.Element, C2.Element) async throws -> Void
) -> Test Create an instance of
Test
for a parameterized function.static func __function<C>(named: String, in: Any.Type?, xcTestCompatibleSelector: __XCTestCompatibleSelector?, displayName: String?, traits: [any TestTrait], arguments: @escaping () async throws -> C, sourceLocation: SourceLocation, parameters: [__Parameter], testFunction: @escaping (C.Element) async throws -> Void
) -> Test Create an instance of
Test
for a parameterized function.static func __function<C, E1, E2>(named: String, in: Any.Type?, xcTestCompatibleSelector: __XCTestCompatibleSelector?, displayName: String?, traits: [any TestTrait], arguments: @escaping () async throws -> C, sourceLocation: SourceLocation, parameters: [__Parameter], testFunction: @escaping ((E1, E2)) async throws -> Void
) -> Test Create an instance of
Test
for a parameterized function.static func __function(named: String, in: Any.Type?, xcTestCompatibleSelector: __XCTestCompatibleSelector?, displayName: String?, traits: [any TestTrait], sourceLocation: SourceLocation, parameters: [__Parameter], testFunction: @escaping () async throws -> Void
) -> Test Create an instance of
Test
for a function.static func __type(Any.Type, displayName: String?, traits: [any SuiteTrait], sourceLocation: SourceLocation
) -> Test Create an instance of
Test
for a suite type.
Instance members
var associatedBugs: [Bug]
The set of bugs associated with this test.
var comments: [Comment]
The complete set of comments about this test from all of its traits.
var displayName: String?
The customized display name of this instance, if specified.
var id: ID
var isParameterized: Bool
Whether or not this test is parameterized.
var isSuite: Bool
Whether or not this instance is a test suite containing other tests.
var name: String
The name of this instance.
var sourceLocation: SourceLocation
The source location of this test.
var traits: [any Trait]
The set of traits added to this instance when it was initialized.
func hash(into: inout Hasher
)
Show system interfaces (5)
Hide system interfaces
var isSynthesized: Bool
Whether or not this instance was synthesized at runtime.
var parameters: [Parameter]?
The test function parameters, if any.
nonisolated(unsafe) var xcTestCompatibleSelector: __XCTestCompatibleSelector?
The XCTest-compatible Objective-C selector corresponding to this instance’s underlying test function.
func adjustedTimeLimit(configuration: Configuration
) -> Duration? Get the maximum amount of time the cases of this test may run for, taking the current configuration and any library-imposed rules into account.
func comments<T>(from: T.Type
) -> [Comment] The complete set of comments about this test from all traits of a certain type.