Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swift build --product package-namePackageTest doesn't build swift-testing tests #7374

Open
1 task done
weissi opened this issue Feb 28, 2024 · 1 comment
Open
1 task done
Assignees
Labels
bug swift build Changes impacting `swift build` swift test Changes impacting `swift test` tool

Comments

@weissi
Copy link
Member

weissi commented Feb 28, 2024

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

  • Confirmed reproduction steps with SwiftPM CLI.

Description

When I run swift build --product package-namePackageTest it doesn't build the swift-testing tests.

Expected behavior

Builds swift-testing tests.

Actual behavior

Doesn't build swift-testing tests.

error: posix_spawn error: No such file or directory (2), `["/tmp/package-name/.build/arm64-apple-macosx/debug/package-namePackageTests.swift-testing", "--list-tests"]`
error: ExitCode(rawValue: 1)
[0/1] Planning builderror: no tests found; create a target in the 'Tests' directory

Steps to reproduce

  1. Get hold of a package that uses swift-testing
  2. rm -rf .build # to make sure this is clean
  3. swift build --product package-namePackageTest
  4. swift test list --skip-build

Swift Package Manager version/commit hash

No response

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

No response

@weissi weissi added the bug label Feb 28, 2024
@grynspan grynspan added the swift test Changes impacting `swift test` tool label Feb 28, 2024
@grynspan
Copy link
Contributor

This is harder than #7375 because it requires that swift build figure out if an explicitly-specified product (or --target) refers to a test target.

@grynspan grynspan added the swift build Changes impacting `swift build` label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug swift build Changes impacting `swift build` swift test Changes impacting `swift test` tool
Projects
None yet
Development

No branches or pull requests

2 participants