<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTestObservation/testBundleDidFinish(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:objc(pl)XCTestObservation(im)testBundleDidFinish:"
  },
  "title" : "testBundleDidFinish(_:)"
}
-->

# testBundleDidFinish(_:)

Notifies the observer immediately after all tests in a test bundle finish executing.

```
optional func testBundleDidFinish(_ testBundle: Bundle)
```

## Parameters

`testBundle`

The bundle containing the tests that were executed.

## Discussion

This method provides a customization point for any post-testing activity. The test process will generally exit after this method returns, so if there is long running and/or asynchronous work to be done after testing, be sure to implement this method in a way that blocks until all long running activity is complete.

---

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)