exitCode(_:)
Creates a condition that matches when a process terminates with a given exit code.
Declaration
static func exitCode(_ exitCode: CInt) -> ExitTest.ConditionParameters
- exitCode:
The exit code reported by the process.
Mentioned in
Discussion
The C programming language defines two standard exit codes, EXIT_SUCCESS and EXIT_FAILURE. Platforms may additionally define their own non-standard exit codes:
Platform | Header |
|---|---|
macOS | |
Linux | |
FreeBSD | |
OpenBSD | |
Windows |
On macOS, FreeBSD, OpenBSD, and Windows, the full exit code reported by the process is reported to the parent process. Linux and other POSIX-like systems may only reliably report the low unsigned 8 bits (0–255) of the exit code.