# \#xctest

**URL:** https://forums.swift.org/tag/xctest/250.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [\[Pitch\] A Structured Approach to Build and Test Results Data](https://forums.swift.org/t/pitch-a-structured-approach-to-build-and-test-results-data/85799)

<div class="topic-metadata">

**Author:** [@wil-turner](https://forums.swift.org/u/wil-turner)\
**Replies:** 11\
**Last updated:** [July 28, 2026, 10:10pm UTC](https://forums.swift.org/t/pitch-a-structured-approach-to-build-and-test-results-data/85799 "2026-07-28T22:10:49Z")

</div>

Hello Swift community! I would like to pitch the creation of a package containing APIs that provide a unified approach to publishing and consuming results data generated by developer activities, including (but not limit…

---

## [\[Amendment\] ST-0021: Targeted Interoperability between Swift Testing and XCTest](https://forums.swift.org/t/amendment-st-0021-targeted-interoperability-between-swift-testing-and-xctest/86142)

<div class="topic-metadata">

**Author:** [@younata](https://forums.swift.org/u/younata)\
**Replies:** 3\
**Last updated:** [May 4, 2026, 9:19pm UTC](https://forums.swift.org/t/amendment-st-0021-targeted-interoperability-between-swift-testing-and-xctest/86142 "2026-05-04T21:19:00Z")

</div>

Hello Swift Community! In implementing and utilizing interoperability between Swift Testing and XCTest, @jerryjrchen and @smontgomery uncovered an oversight in the original proposal. As originally proposed, the "limited…

---

## [\[Amended\] ST-0021: Targeted Interoperability between Swift Testing and XCTest](https://forums.swift.org/t/amended-st-0021-targeted-interoperability-between-swift-testing-and-xctest/86479)

<div class="topic-metadata">

**Author:** [@younata](https://forums.swift.org/u/younata)\
**Replies:** 0\
**Last updated:** [May 4, 2026, 9:18pm UTC](https://forums.swift.org/t/amended-st-0021-targeted-interoperability-between-swift-testing-and-xctest/86479 "2026-05-04T21:18:29Z")

</div>

Hello Swift Community! The amendment for ST-0021: Targeted Interoperability between Swift Testing and XCTest ran between 2026-04-21 and 2026-04-29. The feedback was very light, with no dissent. After some brief discuss…

---

## [Testing Workgroup meeting April 20, 2026](https://forums.swift.org/t/testing-workgroup-meeting-april-20-2026/86116)

<div class="topic-metadata">

**Author:** [@smontgomery](https://forums.swift.org/u/smontgomery)\
**Replies:** 0\
**Last updated:** [April 19, 2026, 7:14pm UTC](https://forums.swift.org/t/testing-workgroup-meeting-april-20-2026/86116 "2026-04-19T19:14:34Z")

</div>

Hi everyone, The Testing Workgroup will meet tomorrow, Monday, April 20, 2026 at 1:05pm PT. Topics Here are a few topics we'll likely touch on at this meeting: Current proposals in review: ST-0022: Custom reflection…

---

## [Swift-test-kit: Composable property-based testing, stateful testing, structured diffs, and more for Swift Testing and XCTest](https://forums.swift.org/t/swift-test-kit-composable-property-based-testing-stateful-testing-structured-diffs-and-more-for-swift-testing-and-xctest/85697)

<div class="topic-metadata">

**Author:** [@broken-circle](https://forums.swift.org/u/broken-circle)\
**Replies:** 0\
**Last updated:** [March 30, 2026, 5:18pm UTC](https://forums.swift.org/t/swift-test-kit-composable-property-based-testing-stateful-testing-structured-diffs-and-more-for-swift-testing-and-xctest/85697 "2026-03-30T17:18:30Z")

</div>

swift-test-kit extends Swift Testing and XCTest with composable test evaluators, advanced assertions, structural diffs, and expression capture. The package offers two libraries with identical APIs: SwiftTestKit and XCTes…

---

## [Testing Workgroup meeting March 9, 2026](https://forums.swift.org/t/testing-workgroup-meeting-march-9-2026/85208)

<div class="topic-metadata">

**Author:** [@smontgomery](https://forums.swift.org/u/smontgomery)\
**Replies:** 0\
**Last updated:** [March 8, 2026, 3:47am UTC](https://forums.swift.org/t/testing-workgroup-meeting-march-9-2026/85208 "2026-03-08T03:47:16Z")

</div>

Hi everyone, The Testing Workgroup will meet Monday, March 9, 2026 at 1:05pm PT. Topics Here are a few potential topics we may touch on at this meeting: Current proposals in review: ST-0021: Targeted Interoperabilit…

---

## [How to get accurate test duration measurements for Testing and XCTest?](https://forums.swift.org/t/how-to-get-accurate-test-duration-measurements-for-testing-and-xctest/83177)

<div class="topic-metadata">

**Author:** [@patryk](https://forums.swift.org/u/patryk)\
**Replies:** 9\
**Last updated:** [March 4, 2026, 9:54pm UTC](https://forums.swift.org/t/how-to-get-accurate-test-duration-measurements-for-testing-and-xctest/83177 "2026-03-04T21:54:05Z")

</div>

Hello, I'm currently working on a project that compares test performance between the XCTest and Testing. However, I've found myself a bit stuck in the process - specifically, on how to ensure the results are as accurate…

---

## [Testing Workgroup meeting February 9, 2026](https://forums.swift.org/t/testing-workgroup-meeting-february-9-2026/84609)

<div class="topic-metadata">

**Author:** [@smontgomery](https://forums.swift.org/u/smontgomery)\
**Replies:** 0\
**Last updated:** [February 6, 2026, 10:43pm UTC](https://forums.swift.org/t/testing-workgroup-meeting-february-9-2026/84609 "2026-02-06T22:43:21Z")

</div>

Hi everyone, The Testing Workgroup will meet Monday, February 9, 2026 at 1:05pm PT. Potential topics Here are a few potential topics we might touch on at this meeting: Current proposals in review (ST-0019, ST-0020). F…

---

## [Testing Workgroup meeting January 26, 2026](https://forums.swift.org/t/testing-workgroup-meeting-january-26-2026/84354)

<div class="topic-metadata">

**Author:** [@smontgomery](https://forums.swift.org/u/smontgomery)\
**Replies:** 0\
**Last updated:** [January 25, 2026, 7:58pm UTC](https://forums.swift.org/t/testing-workgroup-meeting-january-26-2026/84354 "2026-01-25T19:58:11Z")

</div>

Hi everyone, The Testing Workgroup will meet Monday, January 26, 2026 (tomorrow) at 1:05pm PT. Potential topics Here are a few potential topics we might touch on at this meeting: Current proposals in review (ST-0018,…

---

## [Assert that a View has a specific accessibility traits modifier](https://forums.swift.org/t/assert-that-a-view-has-a-specific-accessibility-traits-modifier/84110)

<div class="topic-metadata">

**Author:** [@feed0](https://forums.swift.org/u/feed0)\
**Replies:** 2\
**Last updated:** [January 13, 2026, 2:55pm UTC](https://forums.swift.org/t/assert-that-a-view-has-a-specific-accessibility-traits-modifier/84110 "2026-01-13T14:55:09Z")

</div>

I have a project using #ViewInspector , which doesn’t seem to have a means to test #accessibilityTraits on view. Is there any other approach? What I have: struct MyView: View { Text("Header") .accessibil…

---

## [Testing Workgroup meeting December 1, 2025](https://forums.swift.org/t/testing-workgroup-meeting-december-1-2025/83469)

<div class="topic-metadata">

**Author:** [@smontgomery](https://forums.swift.org/u/smontgomery)\
**Replies:** 0\
**Last updated:** [November 30, 2025, 3:38am UTC](https://forums.swift.org/t/testing-workgroup-meeting-december-1-2025/83469 "2025-11-30T03:38:05Z")

</div>

As I mentioned recently, we're posting here before each upcoming meeting of the Testing Workgroup for visibility in case others would like to participate. Next meeting The workgroup will meet this coming Monday, Decembe…

---

## [Testing with --sanitize=address with a single, empty swift test reported leaks (when XCTest is enabled)](https://forums.swift.org/t/testing-with-sanitize-address-with-a-single-empty-swift-test-reported-leaks-when-xctest-is-enabled/83416)

<div class="topic-metadata">

**Author:** [@Joseph\_Heck](https://forums.swift.org/u/Joseph_Heck)\
**Replies:** 3\
**Last updated:** [November 25, 2025, 10:20pm UTC](https://forums.swift.org/t/testing-with-sanitize-address-with-a-single-empty-swift-test-reported-leaks-when-xctest-is-enabled/83416 "2025-11-25T22:20:39Z")

</div>

I was messing around with a side project, and in the process of setting up CI for a Swift library, I thought "Hey, let's enable the address sanitization when running the tests". At the moment, I don't have any tests - t…

---

## [\[Pitch\] Targeted Interoperability between Swift Testing and XCTest](https://forums.swift.org/t/pitch-targeted-interoperability-between-swift-testing-and-xctest/82505)

<div class="topic-metadata">

**Author:** [@jerryjrchen](https://forums.swift.org/u/jerryjrchen)\
**Replies:** 18\
**Last updated:** [November 22, 2025, 12:10pm UTC](https://forums.swift.org/t/pitch-targeted-interoperability-between-swift-testing-and-xctest/82505 "2025-11-22T12:10:36Z")

</div>

Hello Swift Testers! I’d like your feedback on a proposal for targeted interoperability between Swift Testing and XCTest. Proposal: https://github.com/jerryjrchen/swift-evolution/blob/swt-xct-interop/proposals/testing/N…

---

## [addTeardownBlock completion assigned to the @MainActor](https://forums.swift.org/t/addteardownblock-completion-assigned-to-the-mainactor/83255)

<div class="topic-metadata">

**Author:** [@dataports](https://forums.swift.org/u/dataports)\
**Replies:** 1\
**Last updated:** [November 17, 2025, 9:06pm UTC](https://forums.swift.org/t/addteardownblock-completion-assigned-to-the-mainactor/83255 "2025-11-17T21:06:15Z")

</div>

Hi all, I’m midway through a Swift 6 migration and have been migrating some unit test files recently and have been struggling a bit with whather to use MainActor in unit tests as a means to isolate certain bits of code …

---

## [Testing Workgroup meetings](https://forums.swift.org/t/testing-workgroup-meetings/83252)

<div class="topic-metadata">

**Author:** [@smontgomery](https://forums.swift.org/u/smontgomery)\
**Replies:** 0\
**Last updated:** [November 17, 2025, 4:06am UTC](https://forums.swift.org/t/testing-workgroup-meetings/83252 "2025-11-17T04:06:37Z")

</div>

Hi everyone, Since it was formed this past March, the Testing Workgroup has been meeting every other Monday to discuss topics related to Swift Testing, XCTest, and testing in Swift in general. We've helped develop and r…

---

## [XCTest: data race detected](https://forums.swift.org/t/xctest-data-race-detected/75322)

<div class="topic-metadata">

**Author:** [@andreabou](https://forums.swift.org/u/andreabou)\
**Replies:** 4\
**Last updated:** [September 22, 2025, 9:25am UTC](https://forums.swift.org/t/xctest-data-race-detected/75322 "2025-09-22T09:25:07Z")

</div>

Hello, The XCTest framework does not seem to be compliant with the Swift 6 concurrency model. See the example below: Test.swift: @globalActor actor TestActor: GlobalActor { static let shared: TestActor = .init() }…

---

## [What you need to know before migrating to Swift Testing](https://forums.swift.org/t/what-you-need-to-know-before-migrating-to-swift-testing/81005)

<div class="topic-metadata">

**Author:** [@soumyamahunt](https://forums.swift.org/u/soumyamahunt)\
**Replies:** 6\
**Last updated:** [July 10, 2025, 4:58pm UTC](https://forums.swift.org/t/what-you-need-to-know-before-migrating-to-swift-testing/81005 "2025-07-10T16:58:29Z")

</div>

Hi Everyone. I have written a post on medium going through some of the gotchas you might face when migrating to Swift Testing from XCTest: What you need to know before migrating to Swift Testing | by Soumya Mahunt | Jul…

---

## [What's New in Testing - Swift 6.2/Xcode 26](https://forums.swift.org/t/whats-new-in-testing-swift-6-2-xcode-26/80688)

<div class="topic-metadata">

**Author:** [@younata](https://forums.swift.org/u/younata)\
**Replies:** 5\
**Last updated:** [July 2, 2025, 4:55pm UTC](https://forums.swift.org/t/whats-new-in-testing-swift-6-2-xcode-26/80688 "2025-07-02T16:55:34Z")

</div>

Hi all, A couple weeks ago, I gave a talk at One More Thing on What's New in Testing (that talk was recorded, and I'll update this thread once the video is edited & published). Today, I published a blog post about it. h…

---

## [Transitive "build for testing" / "enable testability" for local packages?](https://forums.swift.org/t/transitive-build-for-testing-enable-testability-for-local-packages/73230)

<div class="topic-metadata">

**Author:** [@nathan-sofia](https://forums.swift.org/u/nathan-sofia)\
**Replies:** 3\
**Last updated:** [May 26, 2025, 8:40am UTC](https://forums.swift.org/t/transitive-build-for-testing-enable-testability-for-local-packages/73230 "2025-05-26T08:40:35Z")

</div>

Hello, I would like to have the "build for testing" / "enable testability" flag be propagated to the local packages dependencies of my app when I build the unit tests target. In the end, I'd like to have @testable impor…

---

## [Showing individual #expect() / XCTAssert() successes in unit tests](https://forums.swift.org/t/showing-individual-expect-xctassert-successes-in-unit-tests/79779)

<div class="topic-metadata">

**Author:** [@tera](https://forums.swift.org/u/tera)\
**Replies:** 2\
**Last updated:** [May 8, 2025, 4:04pm UTC](https://forums.swift.org/t/showing-individual-expect-xctassert-successes-in-unit-tests/79779 "2025-05-08T16:04:14Z")

</div>

Is it possible to see not just failures but the individual successes (of #expect() / XCTAssert()), e.g. in Xcode's console? Or even in the UI? Either in XCTest or in the new swift testing is good for me.

---

## [Announcing the Testing Workgroup](https://forums.swift.org/t/announcing-the-testing-workgroup/78336)

<div class="topic-metadata">

**Author:** [@smontgomery](https://forums.swift.org/u/smontgomery)\
**Replies:** 2\
**Last updated:** [March 7, 2025, 4:54am UTC](https://forums.swift.org/t/announcing-the-testing-workgroup/78336 "2025-03-07T04:54:07Z")

</div>

I'm excited to announce the formation of a new Testing Workgroup for Swift! This team will help guide the experience, libraries, and tools for testing Swift code. The idea of creating a testing workgroup first came up d…

---

## [Make SwiftPM run XCTest and Testing tests in parallel by default?](https://forums.swift.org/t/make-swiftpm-run-xctest-and-testing-tests-in-parallel-by-default/78348)

<div class="topic-metadata">

**Author:** [@Finagolfin](https://forums.swift.org/u/Finagolfin)\
**Replies:** 15\
**Last updated:** [March 27, 2025, 10:05pm UTC](https://forums.swift.org/t/make-swiftpm-run-xctest-and-testing-tests-in-parallel-by-default/78348 "2025-03-27T22:05:39Z")

</div>

SwiftPM has long run XCTest tests serially by default, which I usually override with the --parallel flag. However, it runs the new Testing tests in parallel by default, so if a codebase uses both, as many might be transi…

---

## [Can I test a package without building every single target?](https://forums.swift.org/t/can-i-test-a-package-without-building-every-single-target/57921)

<div class="topic-metadata">

**Author:** [@crichez](https://forums.swift.org/u/crichez)\
**Replies:** 2\
**Last updated:** [March 9, 2025, 12:42pm UTC](https://forums.swift.org/t/can-i-test-a-package-without-building-every-single-target/57921 "2025-03-09T12:42:33Z")

</div>

Objective I am looking to run tests defined in a test target by exclusively building the test target and its declared dependencies. This means skipping targets not explicitly defined as dependencies in that test target's…

---

## [XCTest xUnit Experimental failure messages](https://forums.swift.org/t/xctest-xunit-experimental-failure-messages/77918)

<div class="topic-metadata">

**Author:** [@bkhouri](https://forums.swift.org/u/bkhouri)\
**Replies:** 0\
**Last updated:** [February 17, 2025, 6:41pm UTC](https://forums.swift.org/t/xctest-xunit-experimental-failure-messages/77918 "2025-02-17T18:41:51Z")

</div>

Hello folks, Currently, when running swift test --parallel --xunit-output \<myfile\> , Swift Package Manager can generate up to two files, one for XML for XCTest and another for Swift Testing. If there are any failed tes…

---

## [Missing required module 'Testing'](https://forums.swift.org/t/missing-required-module-testing/74675)

<div class="topic-metadata">

**Author:** [@varunpullur25](https://forums.swift.org/u/varunpullur25)\
**Replies:** 4\
**Last updated:** [February 4, 2025, 3:37pm UTC](https://forums.swift.org/t/missing-required-module-testing/74675 "2025-02-04T15:37:10Z")

</div>

Recently i saw an error in the Xcode 16, when ever i try to build the app for testing it is throwing this error missing required module 'Testing'. Everything was working fine in Xcode 15 but now my UI tests are not comp…

---

## [Image XCTAttachment replacement](https://forums.swift.org/t/image-xctattachment-replacement/77310)

<div class="topic-metadata">

**Author:** [@car5ten](https://forums.swift.org/u/car5ten)\
**Replies:** 3\
**Last updated:** [January 20, 2025, 2:29pm UTC](https://forums.swift.org/t/image-xctattachment-replacement/77310 "2025-01-20T14:29:37Z")

</div>

We are currently using XCTAttachment for snapshot testing and add several images to an XCTIssue. As far as I can tell, currently Comment only support strings or did I miss something?

---

## [Objc XCTest target unable to see ProductModuleName-Swift.h](https://forums.swift.org/t/objc-xctest-target-unable-to-see-productmodulename-swift-h/76492)

<div class="topic-metadata">

**Author:** [@NSExceptional](https://forums.swift.org/u/NSExceptional)\
**Replies:** 0\
**Last updated:** [December 9, 2024, 9:42pm UTC](https://forums.swift.org/t/objc-xctest-target-unable-to-see-productmodulename-swift-h/76492 "2024-12-09T21:42:49Z")

</div>

I'm trying to follow this guide to import my Swift code into an external Objc target. I chose an XCTest target because hey, tests, two birds one stone. My Swift code is in a static library target. It consists of one cla…

---

## [Swift 5.10 Concurrency and XCTest](https://forums.swift.org/t/swift-5-10-concurrency-and-xctest/69929)

<div class="topic-metadata">

**Author:** [@stephencelis](https://forums.swift.org/u/stephencelis)\
**Replies:** 28\
**Last updated:** [December 5, 2024, 2:15am UTC](https://forums.swift.org/t/swift-5-10-concurrency-and-xctest/69929 "2024-12-05T02:15:29Z")

</div>

How baked are some of Xcode 15.3's concurrency warnings? One notable issue is that XCTestCase can no longer be annotated @MainActor: @MainActor class MyTests: XCTestCase { ⚠️ :warning: Main actor-isolated class 'MyTe…

---

## [Issues with setUp() and tearDown() in XCTest for Swift 6](https://forums.swift.org/t/issues-with-setup-and-teardown-in-xctest-for-swift-6/75990)

<div class="topic-metadata">

**Author:** [@IvanLevin](https://forums.swift.org/u/IvanLevin)\
**Replies:** 1\
**Last updated:** [November 14, 2024, 11:32am UTC](https://forums.swift.org/t/issues-with-setup-and-teardown-in-xctest-for-swift-6/75990 "2024-11-14T11:32:49Z")

</div>

Hello! I'm working on migration a project to Swift 6 and encountering the following error in tests: "Call to main actor-isolated initializer 'init(viewModel:)' in a synchronous nonisolated context". final class MicOnboa…

---

## [A New Approach to Testing in Swift](https://forums.swift.org/t/a-new-approach-to-testing-in-swift/67425)

<div class="topic-metadata">

**Author:** [@smontgomery](https://forums.swift.org/u/smontgomery)\
**Replies:** 118\
**Last updated:** [October 24, 2024, 1:11pm UTC](https://forums.swift.org/t/a-new-approach-to-testing-in-swift/67425 "2024-10-24T13:11:16Z")

</div>

Hi everyone, I’m excited to announce a new open source project exploring improvements to the testing experience for Swift. My colleagues @briancroom, @grynspan, @chefski, @Dennis and I have been working on this in recen…

[Next page](https://forums.swift.org/tag/xctest/250.md?match_all_tags=true&page=1&tags%5B%5D=xctest)
