I find it really difficult when refactoring huge codebase, changing tests etc. to find on my code coverage report what lines I'm no longer covering.
Is there any tool/way to get diff from two reports?
I find it really difficult when refactoring huge codebase, changing tests etc. to find on my code coverage report what lines I'm no longer covering.
Is there any tool/way to get diff from two reports?
Copyright © 2021 Jogjafile Inc.
Gcovr currently has no support for showing coverage changes. This gives you roughly the following two options:
lcovtool with interesting support for differential coverage. Many third party tools can show coverage changes, for example the Codecov.io service. If you're running some CI system, there might already be a feature of plugin to highlight coverage changes.As an example of a script to process gcovr's JSON output, the following would alert you of lines that lost coverage:
Example usage:
Example output:
You could create a similar script that also opens the original source files to create an annotated report with all coverage changes, similar to the textual reports generated by
gcov.