Skip to content

Development and Testing

André Borchert edited this page Aug 11, 2026 · 15 revisions

Development and Testing

The project uses SwiftPM and Swift Testing on macOS 26 with Xcode 26.6 or later and Swift 6.3.3 or later. Both manifests use Swift language mode 6. Run commands from the repository root unless a section says otherwise.

Build

swift package resolve
swift build

The nested package can be built independently:

cd Swift
swift package resolve
swift build

No separate lint or formatting command is configured. swift build is the repository's build and type-checking gate.

Every target opts into Swift strict memory-safety checking. CI also treats warnings as errors and enforces complete concurrency checking plus explicit Sendable declarations. Reproduce that diagnostic build locally with:

./Swift/check-toolchain.sh
swift build \
  -Xswiftc -warnings-as-errors \
  -Xswiftc -strict-concurrency=complete \
  -Xswiftc -require-explicit-sendable

Tests

Run the complete root-package suite:

swift test

Useful focused suites:

swift test --filter WebTransportHTTP3CoreTests
swift test --filter WebTransportTLSCoreTests
swift test --filter WebTransportNetworkRuntimeTests
swift test --filter WebTransportTests

Test targets and their primary scope:

Target Coverage
WebTransportTests Public API, separate processes, loopback networking, stress, release artifacts, and compatibility integration.
WebTransportNetworkRuntimeTests Runtime lifecycle, endpoint handling, deterministic network support, and hardening.
WebTransportHTTP3CoreTests HTTP/3, QPACK, sessions, streams, datagrams, flow control, limits, and malformed input.
WebTransportQUICCoreTests QUIC state, codecs, ACK/loss behavior, malformed input, and property corpora.
WebTransportTLSCoreTests TLS messages, state, key schedule, trust gating, exporter behavior, and hardening.
WebTransportCryptoAppleTests Initial-key derivation and packet protection.
WebTransportUDPAppleTests IPv4/IPv6 loopback and cancellation behavior.

Command-line conformance

swift run WebTransportClient --scenario all
swift run WebTransportServer --scenario all

Each executable runs the same 40-scenario positive and negative protocol matrix. Use --list to inspect scenario names and --help for command syntax.

API and release validation

cd Swift
./check-api-compatibility.sh
./build-release-apple-silicon.sh

The compatibility script builds an external package that imports the public products. The release script performs two clean arm64 builds, checks architecture and product selection, compares normalized binary hashes, and writes WebTransportClient, WebTransportServer, and SHA256SUMS under .build/release-artifacts/. Package tests and CI smoke-test those artifacts.

Validation by change type

Change Minimum evidence
Documentation Source/config fact check, local and Wiki link checks, rendered Markdown review.
Public API Build, complete tests, API compatibility script, DocC conversion.
CLI Complete tests and both conformance suites.
Runtime or trust Runtime/public API/process tests plus IPv4 and IPv6 packet loopback.
HTTP/3, QPACK, or sessions HTTP3Core tests and relevant conformance scenarios.
QUIC, TLS, crypto, or UDP Owning target tests plus an integration path.
Release tooling Reproducible release build and CI review.
Interoperability The appropriate runner from [[Release and Interoperability

Environment-sensitive checks must be reported precisely. Do not reuse old generated artifacts as evidence for a new code revision.

Contributor workflow

  1. Identify the owning module and read its nearest tests.
  2. Check public API, protocol, trust, logging, manifest, CI, and documentation effects.
  3. Make the smallest coherent change and cover important negative paths.
  4. Run focused checks, then the broader validation required by the change.
  5. Review the final diff for generated output, credentials, stale claims, and unrelated edits.
  6. Update documentation whenever setup, API, behavior, trust, workflow, or release evidence changes.

Clone this wiki locally