swiftlang/swift-package-manager

Tests in `swift package init --type executable --enable-swift-testing` have no test target

Open

#9149 opened on Sep 17, 2025

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Swift (10,145 stars) (1,462 forks)batch import
bugcommand-line interfacegood first issueswift package initswift test

Description

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

Run swift package init --type executable --enable-swift-testing.

Expected behavior

Tests directory that was created should have a corresponding test target in Package.swift

Actual behavior

Package.swift has not corresponding test target.

Swift Package Manager version/commit hash

main, also reproducible with swift-DEVELOPMENT-SNAPSHOT-2025-09-14-a

Swift & OS version (output of swift --version ; uname -a)

> swift --version
Apple Swift version 6.3-dev (LLVM 73f0f4667f22bd1, Swift c987ea9c8e684c2)
Target: arm64-apple-macosx15.0

> swift build --version
Swift Package Manager - Swift 6.3.0-dev

Contributor guide