SE-0501: HTML Coverage Report

The proposal offers the option of specifying generating multiple coverage formats in a single invocation. If we support the -Xcov argument, we need to think of a way support which arguments must be passed down to one format and which to the other.

Take this example

swift test --enable-coverage --coverage-format html --coverage-format json -Xcov --title -Xcov "My title"

The -Xcov arguments are only supported in the HTML format

What do folks think about having the following syntax as a value to -Xcov?

-Xcov [<coverage-format>:]<value>

Here are some example:

  • -Xcov html:--title : arguments --title is only sent to the HTML coverage report generation
  • -Xcov json:myarg: argument myarg is only sent to the JSON coverage report
  • -Xcov commonArg: the argument commonArg is sent to all coverage format reports.

The downside I find is the lack of consistency with the other -Xarg arguments. I'm open to hearing feedback and suggestions.