You can write multiple report formats with one gcovr invocation by passing the output filename directly to the report format flag. If no filename is specified for the format, the value from -o/--output<gcovr --output>
is used by default, which itself defaults to stdout.
The following report format flags can take an optional output file name:
gcovr --txt
gcovr --html
gcovr --html-details
gcovr --html-nested
gcovr --csv
gcovr --json
gcovr --json-summary
gcovr --clover
gcovr --cobertura
gcovr --coveralls
gcovr --jacoco
gcovr --lcov
gcovr --sonarqube
If the value given to the output option ends with a path separator (/
or \
) it is used a directory which is created first and a default filename depending on the format is used.
Note that --html-details<gcovr --html-details>
and --html-nested<gcovr --html-nested>
override any value of --html<gcovr --html>
if it is present.