testing ([current](https://www.swift.org/documentation/server/guides/testing.html))
Open
@heckj is already working on this.
Since Nov 5, 2025.
content migration
- Dominant language
- Python
- Stars
- 28
- Forks
- 5
- Avg merge
- 18h 33m
- Merged PRs (30d)
- 18
Description
-
🧭 North Star: show examples of how to run tests for executables (& libraries, but focus on executables)
- (core path: developing on Mac, running on Linux)
- (presumption that tests are unit tests)
- show how to run test within a linux environment
- using container on the CLI
- show how to use sanitizers (thread, asan, while testing)
- show how to capture test coverage & get a simple report
- XCTest & Swift Testing (prefer Swift testing)
- reference “testing in a CI article” (new/separate article)
-
🗺️ (Outline)
- use
swift test-v- ``-vv`
listlast--filter ...-s
- run swift test in a container:
docker run -v "$PWD:/code" -w /code swift:latest swift test
- Using sanitizers
- thread:
swift test --sanitize=thread
- address:
swift test --sanitize=addressswift test -c release --sanitize=address
- thread:
- (something about capturing test coverage)
swift test --enable-code-coverage/--disable-code-coverage--show-codecov-path--xunit-output <xunit-output>- ? how is this intended to be used
swift test --xunit-output fredfile==>fredfile-swift-testingswift test --xunit-output .==> nothing- https://forums.swift.org/t/swift-testing-and-vscode/70441
- https://github.com/swiftlang/swift-package-manager/issues/4752
- XCTest and swift-testing
--enable-xctest/--disable-xctest--enable-swift-testing/--disable-swift-testing
- Signposts / links to additional content on platform-specific testing techniques
- Accessing resources (fixtures) from your tests
- ?? should this be it's own article in swift-testing?
- (link to an article in swift-testing on using TestScoping & SuiteTrait)
- (link to an article walking through how to test a hummingbird app)
- (link to an article walking through how to test a vapor app)
- (link to an article walking through how to test a grpc service)
- (placeholder) - link to "functional tests", setting up dependent services
- link to integration tests
- Accessing resources (fixtures) from your tests
- use
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.