You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently you can exclude files and directories with -e and company. It would be nice to have a possibility to add support for an exclude file. The way it works is that if you have a tests subdirectory that you don't want to have in the coverage reports, then you'd create a (potentially empty) file tests/.gcovr-ignore. Then gcovr would not print coverage stats for that directory or any of its subdirectories. The front page might list all directories ignored in this way for clarity.
This would be convenient for tests, third party code and so on. You can also change which parts of the source tree to ignore without having to edit the commands used to invoke gcovr.
The text was updated successfully, but these errors were encountered:
Hello @jpakkane, the HEAD version of gcovr (not yet released on PyPI) has support for configuration files (designed in #229, implemented in #281). You can then add a gcovr.cfg file to your project's --root directory, and put any command line options into that file, using a syntax similar to INI files. For example:
exclude = tests/
exclude = third-party/
This works exactly like adding those to the front of the command line arguments, here: gcovr --exclude test/ --exclude third-part/ ...
The list of exclusions is not currently provided in the HTML report, and I don't know whether that would be helpful in the general case.
You could try installing gcovr directly from GitHub (e.g. python3 -m pip install git+https://github.com/gcovr/gcovr.git) to test that feature. Please let me know if this solves your problem! In the meanwhile, I'm marking this issue as closed.
Currently you can exclude files and directories with
-e
and company. It would be nice to have a possibility to add support for an exclude file. The way it works is that if you have atests
subdirectory that you don't want to have in the coverage reports, then you'd create a (potentially empty) filetests/.gcovr-ignore
. Then gcovr would not print coverage stats for that directory or any of its subdirectories. The front page might list all directories ignored in this way for clarity.This would be convenient for tests, third party code and so on. You can also change which parts of the source tree to ignore without having to edit the commands used to invoke gcovr.
The text was updated successfully, but these errors were encountered: