<!--
{
  "availability" : [
    "Swift: 6.2.0 -",
    "Xcode: 26.0.0 -",
    "macOS: -",
    "swift: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Testing",
  "identifier" : "/documentation/Testing/ExitTest/Condition/signal(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Swift Testing",
      "Testing"
    ],
    "preciseIdentifier" : "s:7Testing8ExitTestV9ConditionV6signalyAEs5Int32VFZ"
  },
  "title" : "signal(_:)"
}
-->

# signal(_:)

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

```
static func signal(_ signal: CInt) -> ExitTest.Condition
```

## Parameters

`signal`

The signal that caused the process to exit.

## Discussion

The C programming language defines a number of standard signals. Platforms
may additionally define their own non-standard signal codes:

|Platform|Header                                                                                                                          |
|--------|--------------------------------------------------------------------------------------------------------------------------------|
|macOS   |[`<signal.h>`](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/signal.3.html)|
|Linux   |[`<signal.h>`](https://www.kernel.org/doc/man-pages/online/pages/man7/signal.7.html)                                            |
|FreeBSD |[`<signal.h>`](https://man.freebsd.org/cgi/man.cgi?signal(3))                                                                   |
|OpenBSD |[`<signal.h>`](https://man.openbsd.org/signal.3)                                                                                |
|Windows |[`<signal.h>`](https://learn.microsoft.com/en-us/cpp/c-runtime-library/signal-constants)                                        |

---

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)