swiftlang / swiftlang/docs

testing ([current](https://www.swift.org/documentation/server/guides/testing.html))

Open
#18 4 comments 1 reaction 1 assignee View on GitHub

@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

current content

  • 🧭 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`
      • list
      • last
      • --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=address
        • swift test -c release --sanitize=address
    • (something about capturing test coverage)
    • 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.