I have a WIP implementation here: swiftlang/swift-package-manager#9076
To try it, build the project and then invoke the built swift-test binary directly. On *nix system, this could look like:
❯ swift build
❯ $(swift build --show-bin-path)/swift-test --help
<...SNIP..>
COVERAGE OPTIONS:
--show-codecov-path, --show-code-coverage-path, --show-coverage-path
Print the path of the exported code coverage JSON file.
--print-codecov-path-mode, --print-code-coverage-path-mode, --print-coverage-path-mode <print-codecov-path-mode>
How to display the paths of the selected code coverage file formats. (default: text)
json - Display the output in JSON format.
text - Display the output as plain text.
--enable-codecov, --enable-code-coverage, --enable-coverage/--disable-codecov, --disable-code-coverage, --disable-coverage
Enable code coverage. (default: --disable-codecov)
--codecov-format, --code-coverage-format, --coverage-format <format>
Format of the code coverage output. Can be specified multiple times. (values: json, html; default: Produces a JSON coverage report.)
<...SNIP...>
The help text for the --coverage-format option does not appear correctly as each item should have an associated help text. This is tracked by apple/swift-argument-parser#818.
The PR currently allows specifying multiple coverage format by providing --coverage-format <format> multiple times.
What works well? What needs to be improved?
Sam