<!--
{
  "availability" : [
    "Swift: 6.2.0 -",
    "Xcode: 26.0.0 -",
    "macOS: -",
    "swift: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Testing",
  "identifier" : "/documentation/Testing/ExitTest/Condition",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Swift Testing",
      "Testing"
    ],
    "preciseIdentifier" : "s:7Testing8ExitTestV9ConditionV"
  },
  "title" : "ExitTest.Condition"
}
-->

# ExitTest.Condition

The possible conditions under which an exit test will complete.

```
struct Condition
```

## Overview

Values of this type are used to describe the conditions under which an
exit test is expected to pass or fail by passing them to
[`expect(processExitsWith:observing:_:sourceLocation:performing:)`](/documentation/Testing/expect(processExitsWith:observing:_:sourceLocation:performing:)) or
[`require(processExitsWith:observing:_:sourceLocation:performing:)`](/documentation/Testing/require(processExitsWith:observing:_:sourceLocation:performing:)).

## Topics

### Successful exit conditions

[`static var success: ExitTest.Condition`](/documentation/Testing/ExitTest/Condition/success)

A condition that matches when a process exits normally.

### Failing exit conditions

[`static var failure: ExitTest.Condition`](/documentation/Testing/ExitTest/Condition/failure)

A condition that matches when a process exits abnormally

[`static func exitCode(CInt) -> ExitTest.Condition`](/documentation/Testing/ExitTest/Condition/exitCode(_:))

Creates a condition that matches when a process terminates with a given
exit code.

[`static func signal(CInt) -> ExitTest.Condition`](/documentation/Testing/ExitTest/Condition/signal(_:))

Creates a condition that matches when a process exits with a given signal.

### Initializers

[`init(ExitStatus)`](/documentation/Testing/ExitTest/Condition/init(_:))

Initialize an instance of this type that matches the specified exit
status.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`Copyable`](/documentation/Swift/Copyable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Escapable`](/documentation/Swift/Escapable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)