<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTestRun/init(test:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:objc(cs)XCTestRun(im)initWithTest:"
  },
  "title" : "init(test:)"
}
-->

# init(test:)

Creates a new test run for the provided test.

```
init(test: XCTest)
```

## Parameters

`test`

An [`XCTest`](/documentation/XCTest/XCTest) instance.

## Return Value

A test run for the provided test.

## Discussion

---

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)