<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTSkipUnless",
  "metadataVersion" : "0.1.0",
  "role" : "Macro",
  "symbol" : {
    "kind" : "Macro",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:@macro@XCTSkipUnless"
  },
  "title" : "XCTSkipUnless"
}
-->

# XCTSkipUnless

Skips remaining tests in a test method unless the specified condition is met.

```
#define XCTSkipUnless(expression, ...)
```

## Discussion

Call this macro to skip any remaining code and assertions in the test method when `expression` evaluates to `false`, and mark the test method as skipped. If a test failure occurs in the test method before the skip, the test runner marks the test method as failed.

---

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)