Skip to content

Conversation

bkhouri
Copy link
Contributor

@bkhouri bkhouri commented Aug 29, 2025

TO BE COMPLETED

When executing tests, we often want to see a coverage report. This add an HTML option.

Depends on: #9162

@bkhouri bkhouri force-pushed the t/main/swift-testing-generate-covreport branch 4 times, most recently from e5b2559 to 8761ac3 Compare September 18, 2025 15:48
@bkhouri bkhouri force-pushed the t/main/swift-testing-generate-covreport branch 6 times, most recently from d184ab9 to be05442 Compare September 29, 2025 04:54
@bkhouri bkhouri force-pushed the t/main/swift-testing-generate-covreport branch from be05442 to 81415e6 Compare September 30, 2025 18:59
Ensure the SwiftBuild build systam has feature parity with the Native
build system as it relates to coverage.

Fixes: swiftlang#9077
Fixes: swiftlang#9197
Issue: rdar://159461439
Currently, `swift test` supports generating a JSON coverage report,
which is great for ingesting into various systems. The JSON coverage
report generation is processed by `llvm-cov`` where SwiftPM is simply
orchestrating the command line invocation. The JSON, however, is not
very "human consumable friendly" while iterating at-desk.

This change adds an additional command line argument to swift test that
allows specify whether to generate a JSON or HTML report. Selecting HTML
will produce a `llvm-cov`` HTML report, that is more easily consumable
by a developer at desk. Similar to the JSON coverage report, Swift
Package Manager is only responsible for constructing the command line
argument that will be passed to `llvm-cov``, which will produce the HTML
report.

Since `llvm-cov show` (which would produce the HTML) has numerous CLI
arguments that allows configurations of the HTML report, this change
supports a response file for configuring the `llvm-cov show` command.
The response file is accessible from the Swift Package project.
@bkhouri bkhouri force-pushed the t/main/swift-testing-generate-covreport branch 2 times, most recently from d3e4b2d to 0f83da6 Compare October 2, 2025 02:14
@bkhouri bkhouri force-pushed the t/main/swift-testing-generate-covreport branch from 0f83da6 to 235517a Compare October 2, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant