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

No way to just-build with code coverage enabled. #7373

Closed
1 task done
dabrahams opened this issue Feb 27, 2024 · 2 comments · Fixed by #7518
Closed
1 task done

No way to just-build with code coverage enabled. #7373

dabrahams opened this issue Feb 27, 2024 · 2 comments · Fixed by #7518
Assignees
Labels
bug swift build Changes impacting `swift build`

Comments

@dabrahams
Copy link
Contributor

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

  • Confirmed reproduction steps with SwiftPM CLI.

Description

See this message in the forums. Everything that was true then appears to be still true today.

Expected behavior

I can

swift build --build-tests --enable-code-coverage
swift test --skip-build --enable-code-coverage

without error and it will produce a coverage report

Actual behavior

error: Unknown option '--enable-code-coverage'

Steps to reproduce

Pick any arbitrary SPM project with tests and

swift build --build-tests --enable-code-coverage
swift test --skip-build --enable-code-coverage

Swift Package Manager version/commit hash

Swift Package Manager - Swift 5.9.0

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

swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0
Darwin davea-mbp16.corp.adobe.com 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000 arm64

@dabrahams dabrahams added the bug label Feb 27, 2024
@grynspan
Copy link
Contributor

This wouldn't be too hard to add (famous last words.) @MaxDesiatov if you like, you can assign this to me and I can get to it some time in the next couple of weeks.

@grynspan
Copy link
Contributor

Note @dabrahams that code coverage is a build-time feature, so if you say swift build --build-tests and then swift test --skip-build --enable-code-coverage it wouldn't do what you want; it would need to be passed to both commands to be effective. You have that in your example, of course, but I just want to make it clear. :)

@grynspan grynspan added the swift build Changes impacting `swift build` label Feb 28, 2024
@grynspan grynspan closed this as completed May 7, 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`
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants