Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromgcovr/gcovr

generate code coverage reports with gcc/gcov

License

NotificationsYou must be signed in to change notification settings

Spacetown/gcovr

 
 

Repository files navigation

generate GCC code coverage reports

website and documentationbugtrackerGitHub

GitHub Actions build statusCodacy quality statusCodacy coverage statusInstall from PyPIDownloads from PyPIDocumentation StatusGitter chat

Gcovr provides a utility for managing the use of the GNUgcov utilityand generating summarized code coverage results. This command isinspired by the Pythoncoverage.py package, which provides a similarutility for Python.

Thegcovr command can produce different kinds of coverage reports:

CLI OptionUser GuideDescription
default,--txtText Outputcompact human-readable summaries
--htmlHTML Outputoverview of all files
--html-detailsHTML Outputannotated source files
--html-template-dirHTML Outputuse custom set of Jinja2 templates
--csvCSV OutputCSV report summarizing the coverage of each file
--jsonJSON OutputJSON report with source file structure and coverage
--json-summaryJSON OutputJSON summary coverage report
--markdownMarkdown OutputMarkdown coverage report
--markdown-summaryMarkdown OutputMarkdown summary coverage report
--cloverClover XML Outputmachine readable XML reports inClover format
--coberturaCobertura XML Outputmachine readable XML reports inCobertura format
--coverallsCoveralls JSON Outputmachine readable JSON report inCoveralls format
--jacocoJaCoCo XML Outputmachine readable XML reports inJaCoCo format
--lcovLCOV info Outputmachine readable report inLCOV info format
--sonarqubeSonarQube XML Outputmachine readable XML reports inSonarQube format

Thus, gcovr can be viewedas a command-line alternative to thelcov utility, which runs gcovand generates an HTML-formatted report.The development of gcovr was motivated by the need fortext summaries and XML reports.

Example HTML summary:

./doc/images/screenshot-html.jpeg

Example HTML details:

./doc/images/screenshot-html-details.example.cpp.jpeg

Installation

Gcovr is available as a Python package that can be installed viapip.

Install newest stablegcovr release from PyPI:

pip install gcovr

Install development version from GitHub (needs at least version 21.3 of pip):

pip install git+https://github.com/gcovr/gcovr.git

Quickstart

GCC can instrument the executables to emit coverage data.You need to recompile your code with the following flags:

--coverage -g -O0

Next, run your test suite.This will generate raw coverage files.

Finally, invoke gcovr.This will print a tabular report on the console.

gcovr

You can also generate detailed or nested HTML reports:

gcovr --html-details coverage.htmlgcovr --html-nested coverage.html

Gcovr will create one HTML report per source file and for--html-nested also per directory next to the coverage.htmlsummary.

You should run gcovr from the build directory.The-r option should point to the root of your project.This only matters if you have a separate build directory.For example:

cd build; gcovr -r ..

For complete documentation, read themanual.

Contributing

If you want to report a bug or contribute to gcovr development,please read our contributing guidelines first:https://gcovr.com/en/latest/contributing.html

License

This software is distributed under the 3-clause BSD License.Seehttps://gcovr.com/en/latest/license.html#license-terms for details.Seehttps://gcovr.com/en/latest/license.html#acknowledgementsfor the full list of contributors.

About

generate code coverage reports with gcc/gcov

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python84.0%
  • C++7.7%
  • HTML6.3%
  • CSS1.6%
  • C0.2%
  • Jinja0.1%
  • Other0.1%

[8]ページ先頭

©2009-2025 Movatter.jp