Change Log

gcovr Release History and Change Log

7.0 (25 January 2024)

Known bugs:

Breaking changes:

  • Dropped support for Python 3.7 (#869)

  • The exit code for an error of the reader module is changed from 8 to 64 and for a writer from 7 to 128. (#773)

New features and notable changes:

  • Add --html-template-dir option to use custom Jinja2 templates (#758)

  • Add block numbers and md5 sums of code lines to data model. (#764)

  • If the CSS given with --html-css contains the string /* Comment.Preproc */ no pygments CSS is added anymore. (#786)

  • Add support for Devcontainer and GitHub Codespaces. (#771)

  • Fix Dockerfile.qa to avoid uid conflicts. (#801)

  • Pygments required ≥ 2.13.0. (#799)

  • Add a second theme for HTML report inspired by GitHub. (#793)

  • Add --fail-under-decision and --fail-under-function which will error under a given minimum coverage. (#773)

  • Add function coverage to data model. (#822)

  • Add support for importing Cobertura XML files with --cobertura-add-tracefile option. (#805)

  • Add --jacoco to generate JaCoCo XML format. (#823))

  • Add function coverage to HTML report. (#828)

  • Improve sorting of data in reports (#817):

    • Sort file names alpha numerical and with casefold (see str.casefold) (file_10.c comes after file_0.c).

    • Always sort at the end by filename if line or branch coverage is identical for a file.

    • Add --sort-branches to sort by branches instead of lines, this is the default if --txt-branches is used.

    • Add --sort-reverse to reverse the sort order.

  • Add option to report covered lines in txt report. (#836)

  • Add support for specifying files for search_paths. (#834)

  • Use different color for partial covered lines in HTML report. (#839)

  • Add support to generate LCOV info files. (#830)

  • Add support for FIPS enabled OS when used with Python 3.9. (#850)

  • Reduce file size for detailed HTML reports by merging columns the function lists. (#840)

  • Ignore all negative hits if --gcov-ignore-parse-errors is used. (#852)

  • Use literal options for sorting and TXT metric. (#867)

    • The -b, --txt-branches and --branches are deprecated, use --txt-metric instead. The reason for this is that we have line, branch and decision coverage and handle this with flags is more complex than using an enumeration.

    • The --sort-uncovered and --sort-percentage are deprecated, use --sort instead. The reason for this is that only one sorting order shall be selectable and and an enumeration is easier to handle than several flags.

  • The development branch is renamed from master to main. (#829, #873)

  • Add support for decision coverage metric in text report (#864)

  • Split list of functions into tables with maximum 10000 rows to fix rendering issues. (#858)

Bug fixes and small improvements:

  • Print calls and decision statistics in summary only if values are gathered. (#749)

  • Log the thread name if -j is used. (#752)

  • Collapse also root directory if needed in nested HTML report. (#750)

  • Handle special case of absolute source file paths in gcov output. (#776)

  • Ignore exit code 6 when running gcov (output write error introduced gcc-12). (#781)

  • Change coveralls value from 0.0 to 1.0 if no code lines or branches are present. (#796)

  • Fix symlinked root directories on Windows. (#814)

  • Extend --gcov-ignore-errors to be able to ignore specific gcov errors. (#787)

  • Fix reading of choices options from configuration files (e.g. gcov-ignore-parse-errors). (#816)

  • Fix TypeError during decision analysis. (#784)

  • Use relative paths if possible when running gcov. (#820)

  • Respect :option`--merge-mode-functions`when merging coverage data. (#844)

Documentation:

  • Fix wrong command in How to create a standalone application docs (#792)

  • Update output html to add github style themes (#818)

Internal changes:

6.0 (08 March 2023)

Known bugs:

Breaking changes:

New features and notable changes:

  • New --html-nested for reports that summarize subdirectories with aggregated statistics per directory. (#687)

  • Accept NAN % which is used in GCOV 7.5.0 instead of an invalid value. (#651)

  • New --json-base to define a base bath used in JSON reports. (#656)

  • New --calls to report call coverage: function calls invoked/total (#666)

  • New nox session to generate a portable application with pyinstaller, see How to create a standalone application. (#661)

  • Print a warning if root directory contains symlinks. (#652)

  • Change --keep when calling gcov internaly. (#703)

  • Allow annotations for never executed branches. (#711)

  • Add function merge mode for same function defined in different lines. (#700)

  • Update link to gcovr documentation in HTML report to point to the documentation of the used version. (#723)

  • Add environment SOURCE_DATE_EPOCH to set default for --timestamp. (#729)

Bug fixes and small improvements:

  • Fix --html-tab-size feature. (#650)

  • Fix alphabetical sort of html report, for when there are symlinks. (#685)

  • Handle --version before parsing the configuration file. (#696)

  • Fix reports of excluded coverage. (#409, #503, #663)

  • Fix handling for nonexistent source code for HTML-details and Coveralls reports. (#663)

  • Exclude functions with Exclusion Markers. (#713)

  • Fix problem in decision parser if open block brace is on same line. (#681)

  • Add Python 3.11 to test matrix. (#717)

  • Fix casing of files if filesystem is case insensitive. (#694)

  • Fix deadlock if -j is used and there are errors from gcov execution. (#719)

  • Fix problem in decision parser if case is not on a single line with the break statement. (#738)

  • Do not use realpath for DirectoryPrefixFilter to support symlinks in root directory. (#712)

Documentation:

  • Add detailed reference for the JSON output format. (#663)

Internal changes:

  • Select the --html-theme using CSS classes. (#650)

  • Change and extend cmake tests. (#676)

  • Detect gcc version for running tests. (#686)

  • Use scrubbed data for --update_reference option. (#698)

  • Install ninja with package manager instead of GitHub action. (#699)

  • Rename the reference files coverage.xml to cobertura.xml and the test from xml to cobertura (#721)

  • Add support for clang-14 in our test suite and improve startup performance of docker image. (#731)

  • Compare files by extension in test suite. (#733)

  • Split HTML templates into one file for each part of the page. (#735)

  • Change docker image to be able to use it like the nox command itself. (#734)

5.2 (06 August 2022)

New features and notable changes:

  • Log additional info on gcov parsing errors. (#589)

  • Add support for branch exclude markers. (#644)

  • Additional options to configure the thresholds for lines and branches in HTML separate. (#645)

Bug fixes and small improvements:

  • Remove function coverage from sonarcube report. (#591)

  • Fix parallel processing of gcov data. (#592)

  • Better diagnostics when dealing with corrupted input files. (#593)

  • Accept metadata lines without values (introduced in gcc-11). (#601)

  • Properly close <a> element in detailed HTML report. (#602)

  • Use sign instead of >= in HTML legend. (#603)

  • Using --add-tracefile will now correctly merge branch coverage. (#600)

  • Fix package-level function coverage statistics in Cobertura XML reports. (#605)

  • Respect excluded/noncode lines for aggregated branchcoverage. (#611)

  • Fix list options in configuration file (search-path). (#612)

  • Fix assert and key error in --decisions flag. (#642)

  • Fix adding none existing lines by decision analysis to data model. (#617)

  • Always treat relative paths in config files as relative to the directory of the file. (#615)

  • More flexible .gcov parsing to support files generated by third party tools. (#621, #623)

Internal changes:

  • Fix black check to fail on format errors. (#594)

  • Change session black with no arguments to format all files. (#595)

  • Add gcc-10 and gcc-11 to the test suite. (#597)

  • Improved internal coverage data model to simplify processing. (#600)

  • Use pretty print for cobertura and coveralls in test suite. (#606)

  • Forward nox options --reuse-existing-virtualenvs and --no-install to call inside docker. (#616)

5.1 (26 March 2022)

Breaking changes:

  • Dropped support for Python 3.6 (#550)

  • Changed xml configuration key to cobertura (#552)

  • JSON summary output: all percentages are now reported from 0 to 100 (#570)

New features and notable changes:

Bug fixes and small improvements:

  • Gcov is invoked without localization by setting LC_ALL=C (#513)

  • Gcov is invoked without temporary directories (#525)

  • Gcov: solved problems with file name limitations. (#528)

  • Fixed “root” path in JSON summary report. (#548)

  • Correctly resolve relative filters in configuration files. (#568)

  • HTML output: indicate lines with excluded coverage (#503)

  • HTML output: fixed sanity check to support empty files (#571)

  • HTML output: support jinja2 >= 3.1 (#576)

Documentation:

  • Split documentation into smaller pages (#552)

  • Document used options for gcov (#528)

Internal changes:

  • Replaced own logger with Python’s logging module. (#540)

  • New parser for .gcov file format, should be more robust. (#512)

  • New tests

    • more compilers: clang-10 (#484), clang-13 (#527), gcc-9 (#527)

    • -fprofile-abs-path compiler option (#521)

    • enabled symlink tests for Windows (#539)

  • Improvements to the test suite

    • Use Nox instead of Makefiles to manage QA checks (#516, #555)

    • Can run tests for all compiler versions in one go (#514)

    • More linter checks (#566) and code style enforcement with black (#579)

    • Better XML diffing with yaxmldiff (#495, #509)

    • Share test reference data between compiler versions where possible (#556)

    • Better environment variable handling (#493, #541)

    • Fixed glob patterns for collecting reference files (#533)

    • Add timeout for each single test. (#572)

  • Improvements and fixes to the release process (#494, #537)

  • Normalize shell scripts to Unix line endings (#538, #547)

5.0 (11 June 2021)

Breaking changes:

  • Dropped support for Python 2 and Python 3.5. From now on, gcovr will only support Python versions that enjoy upstream support.

Improvements and new features:

  • Handles spaces in gcov path. (#385)

  • Early fail when output cannot be created. (#382)

  • Add --txt for text output. (#387)

  • Add --csv for CSV output. (#376)

  • Add --exclude-lines-by-pattern to filter out source lines by arbitrary regex. (#356)

  • Add --json-summary to generate a JSON Summary report. (#366)

  • Add --coveralls to generate a Coveralls compatible JSON report. (#328)

  • Add support for output directories. If the output ends with a / or \ it is used as a directory. (#416)

  • Compare paths case insensitive if file system of working directory is case insensitive. (#329)

  • Add wildcard pattern to json --add-tracefile. (#351)

  • Enable --filter and --exclude for Merging coverage. (#373)

  • Only output 100.0% in text and HTML output if really 100.0%, else use 99.9%. (#389)

  • Support relative source location for shadow builds. (#410)

  • Incorrect path for header now can still generate html-details reports (#271)

  • Change format version in JSON output from number to string and update it to “0.2”. (#418, #463)

  • Only remove --root path at the start of file paths. (#452)

  • Fix coverage report for cmake ninja builds with given in-source object-directory. (#453)

  • Add issue templates. (#461)

  • Add --exclude-function-lines to exclude the line of the function definition in the coverage report. (#430)

  • Changes for HTML output format:

Documentation:

Internal changes:

  • Add makefile + dockerfile for simpler testing.

  • Add .gitbugtraq to link comments to issue tracker in GUIs. (#429)

  • Add GitHub actions to test PRs and master branch. (#404)

  • Remove Travis CI. (#419)

  • Remove Appveyor CI and upload coverage report from Windows and Ubuntu from the GitHub actions. (#455)

  • Add check if commit is mentioned in the CHANGELOG.rst. (#457)

  • Move flake8 config to setup.cfg and add black code formatter. (#444)

  • Fix filter/exclude relative path issue in Windows. (#320, #479)

  • Extend test framework for CI:

    • Set make variable TEST_OPTS as environment variable inside docker. (#372)

    • Add make variable USE_COVERAGE to extend flags for coverage report in GitHub actions. (#404)

    • Extend tests to use an unified diff in the assert. Add test options --generate_reference, --update_reference and --skip_clean. (#379)

    • Support multiple output patterns in integration tests. (#383)

    • New option --archive_differences to save the different files as ZIP. Use this ZIP as artifact in AppVeyor. (#392)

    • Add support for gcc-8 to test suite and docker tests. (#423)

    • Run as limited user inside docker container and add test with read only directory. (#445)

4.2 (6 November 2019)

Breaking changes:

  • Dropped support for Python 3.4.

  • Format flag parameters like --xml or --html now take an optional output file name. This potentially changes the interpretation of search paths. In gcovr --xml foo, previous gcovr versions would search the foo directory for coverage data. Now, gcovr will try to write the Cobertura report to the foo file. To keep the old meaning, separate positional arguments like gcovr --xml -- foo.

Improvements and new features:

Known issues:

  • The --keep option only works when using existing gcov files with -g/--use-gcov-files. (#285, #286)

  • Gcovr may get confused when header files in different directories have the same name. (#271)

  • Gcovr may not work when no en_US locale is available. (#166)

Documentation:

Internal changes:

  • More tests. (#269, #268, #269)

  • Refactoring and removal of dead code. (#280)

  • New internal data model.

4.1 (2 July 2018)

  • Fixed/improved --exclude-directories option. (#266)

  • New “Cookbook” section in the documentation. (#265)

4.0 (17 June 2018)

Breaking changes:

  • This release drops support for Python 2.6. (#250)

  • PIP is the only supported installation method.

  • No longer encoding-agnostic under Python 2.7. If your source files do not use the system encoding (probably UTF-8), you will have to specify a --source-encoding. (#148, #156, #256)

  • Filters now use forward slashes as path separators, even on Windows. (#191, #257)

  • Filters are no longer normalized into pseudo-paths. This could change the interpretation of filters in some edge cases.

Improvements and new features:

  • Improved --help output. (#236)

  • Parse the GCC 8 gcov format. (#226, #228)

  • New --source-encoding option, which fixes decoding under Python 3. (#256)

  • New --gcov-ignore-parse-errors flag. By default, gcovr will now abort upon parse errors. (#228)

  • Detect the error when gcov cannot create its output files (#243, #244)

  • Add -j flag to run gcov processes in parallel. (#3, #36, #239)

  • The --html-details flag now implies --html. (#93, #211)

  • The --html output can now be used without an --output filename (#223)

  • The docs are now managed with Sphinx. (#235, #248, #249, #252, #253)

  • New --html-title option to change the title of the HTML report. (#261, #263)

  • New options --html-medium-threshold and --html-high-threshold to customize the color legend. (#261, #264)

Internal changes:

3.4 (12 February 2018)

  • Added --html-encoding command line option (#139).

  • Added --fail-under-line and --fail-under-branch options, which will error under a given minimum coverage. (#173, #116)

  • Better pathname resolution heuristics for --use-gcov-file. (#146)

  • The --root option defaults to current directory ‘.’.

  • Improved reports for “(”, “)”, “;” lines.

  • HTML reports show full timestamp, not just date. (#165)

  • HTML reports treat 0/0 coverage as NaN, not 100% or 0%. (#105, #149, #196)

  • Add support for coverage-04.dtd Cobertura XML format (#164, #186)

  • Only Python 2.6+ is supported, with 2.7+ or 3.4+ recommended. (#195)

  • Added CI testing for Windows using Appveyor. (#189, #200)

  • Reports use forward slashes in paths, even on Windows. (#200)

  • Fix to support filtering with absolute paths.

  • Fix HTML generation with Python 3. (#168, #182, #163)

  • Fix --html-details under Windows. (#157)

  • Fix filters under Windows. (#158)

  • Fix verbose output when using existing gcov files (#143, #144)

3.3 (6 August 2016)

  • Added CI testing using TravisCI

  • Added more tests for out of source builds and other nested builds

  • Avoid common file prefixes in HTML output (#103)

  • Added the --execlude-directories argument to exclude directories from the search for symlinks (#87)

  • Added branches taken/not taken to HTML (#75)

  • Use --object-directory to scan for gcov data files (#72)

  • Improved logic for nested makefiles (#135)

  • Fixed unexpected semantics with --root argument (#108)

  • More careful checks for covered lines (#109)

3.2 (5 July 2014)

  • Adding a test for out of source builds

  • Using the starting directory when processing gcov filenames. (#42)

  • Making relative paths the default in html output.

  • Simplify html bar with coverage is zero.

  • Add option for using existing gcov files (#35)

  • Fixing --root argument processing (#27)

  • Adding logic to cover branches that are ignored (#28)

3.1 (6 December 2013)

  • Change to make the -r/--root options define the root directory for source files.

  • Fix to apply the -p option when the --html option is used.

  • Adding new option, ‘--exclude-unreachable-branches’ that will exclude branches in certain lines from coverage report.

  • Simplifying and standardizing the processing of linked files.

  • Adding tests for deeply nested code, and symbolic links.

  • Add support for multiple —filter options in same manner as —exclude option.

3.0 (10 August 2013)

  • Adding the ‘--gcov-executable’ option to specify the name/location of the gcov executable. The command line option overrides the environment variable, which overrides the default ‘gcov’.

  • Adding an empty “<methods/>” block to <classes/> in the XML output: this makes out XML complient with the Cobertura DTD. (#3951)

  • Allow the GCOV environment variable to override the default ‘gcov’ executable. The default is to search the PATH for ‘gcov’ if the GCOV environment variable is not set. (#3950)

  • Adding support for LCOV-style flags for excluding certain lines from coverage analysis. (#3942)

  • Setup additional logic to test with Python 2.5.

  • Added the --html and --html-details options to generate HTML.

  • Sort output for XML to facilitate baseline tests.

  • Added error when the --object-directory option specifies a bad directory.

  • Added more flexible XML testing, which can ignore XML elements that frequently change (e.g. timestamps).

  • Added the ‘—xml-pretty’ option, which is used to generate pretty XML output for the user manual.

  • Many documentation updates

2.4 (13 April 2012)

  • New approach to walking the directory tree that is more robust to symbolic links (#3908)

  • Normalize all reported path names

    • Normalize using the full absolute path (#3921)

    • Attempt to resolve files referenced through symlinks to a common project-relative path

  • Process gcno files when there is no corresponding gcda file to provide coverage information for unexecuted modules (#3887)

  • Windows compatibility fixes

    • Fix for how we parse source: file names (#3913)

    • Better handling od EOL indicators (#3920)

  • Fix so that gcovr cleans up all .gcov files, even those filtered by command line arguments

  • Added compatibility with GCC 4.8 (#3918)

  • Added a check to warn users who specify an empty --root option (see #3917)

  • Force gcov to run with en_US localization, so the gcovr parser runs correctly on systems with non-English locales (#3898, #3902).

  • Segregate warning/error information onto the stderr stream (#3924)

  • Miscellaneous (Python 3.x) portability fixes

  • Added the master svn revision number as part of the verson identifier

2.3.1 (6 January 2012)

  • Adding support for Python 3.x

2.3 (11 December 2011)

  • Adding the --gcov-filter and --gcov-exclude options.

2.2 (10 December 2011)

  • Added a test driver for gcovr.

  • Improved estimation of the <sources> element when using gcovr with filters.

  • Added revision and date keywords to gcovr so it is easier to identify what version of the script users are using (especially when they are running a snapshot from trunk).

  • Addressed special case mentioned in [comment:ticket:3884:1]: do not truncate the reported file name if the filter does not start matching at the beginning of the string.

  • Overhaul of the --root / --filter logic. This should resolve the issue raised in #3884, along with the more general filter issue raised in [comment:ticket:3884:1]

  • Overhaul of gcovr’s logic for determining gcc/g++’s original working directory. This resolves issues introduced in the original implementation of --object-directory (#3872, #3883).

  • Bugfix: gcovr was only including a <sources> element in the XML report if the user specified -r (#3869)

  • Adding timestamp and version attributes to the gcovr XML report (see #3877). It looks like the standard Cobertura output reports number of seconds since the epoch for the timestamp and a doted decimal version string. Now, gcovr reports seconds since the epoch and “gcovr ``"+``__version__ (e.g. “gcovr 2.2”) to differentiate it from a pure Cobertura report.

2.1 (26 November 2010)

  • Added the --object-directory option, which allows for a flexible specification of the directory that contains the objects generated by gcov.

  • Adding fix to compare the absolute path of a filename to an exclusion pattern.

  • Adding error checking when no coverage results are found. The line and branch counts can be zero.

  • Adding logic to process the -o/--output option (#3870).

  • Adding patch to scan for lines that look like:

    creating `foo'
    

    as well as

    creating 'foo'
    
  • Changing the semantics for EOL to be portable for MS Windows.

  • Add attributes to xml format so that it could be used by hudson/bamboo with cobertura plug-in.

2.0 (22 August 2010)

  • Initial release as a separate package. Earlier versions of gcovr were managed within the ‘fast’ Python package.