gcovr command can also generate a simple
HTML output using the
This generates a HTML summary of the lines executed. In this
example, the file
example1.html is generated, which has the
The default behavior of the
--html option is to generate
HTML for a single webpage that summarizes the coverage for all files. The
HTML is printed to standard output, but the
option is used to specify a file that stores the HTML output.
--html-details option is used to create
a separate web page for each file. Each of these web pages includes
the contents of file with annotations that summarize code coverage. Consider
the following command:
gcovr --html-details example_html.details.html
This generates the following HTML page for the file
Note that the
--html-details option needs
a named output, e.g. via the the
For example, if the output is named
then the web pages generated for each file will have names of the form
--html-self-contained option controls
whether assets like CSS styles are bundled into the HTML file.
--html report defaults to self-contained mode.
--html-details defaults to
in order to avoid problems with the Content Security Policy
of some servers, especially Jenkins.
Changed in version 5.0: Default to external CSS file for