Comments (2)
Yes, these options are confusing. But changing how they behave would confuse even more people :/
The --gcov-exclude-directories
option has guide-level documentation here: https://gcovr.com/en/6.0/guide/filters.html#speeding-up-coverage-data-search
You have correctly understood that this option affects what gcda files are detected.
However, this option uses the same filtering system as other filter/exclude options. That is, the value is a regex matched against a path. It is not matched just against the directory name.
The regex mcopidl
would match a path mcopidl
(in the current directory), but not the path mcop/mcopidl
: the regex starts matching at the beginning of the path (relative to the current working directory).
If you want to exclude any directory mcopidl
, you would have to use the regex (.+/)?mcopidl$
. I'm sorry, I know this is awful, but at least it works consistently across filtering options.
If you know the directory's path (relative to your current working directory), you could use the regex mcop/mcopidl$
instead.
Other remarks on your gcovr invocation:
- The
-j
option has unclear impact on performance. It really depends on the layout of your build directories. - You can combine the
--xml
and-o some-path.xml
options to--cobertura some-path.xml
- If you have many exclusion patterns, consider using a config file. Note that the regexes in a config file match paths relative to that file, not relative to gcovr's working directory or root.
- Trailing
.*
is unnecessary in exclusion patterns. The regex is only anchored at the start, but not at the end. - You might find the file-level
--gcov-exclude
easier to use than the directory-level--exclude-directories
. The latter is useful mostly for steering gcovr away from searching large uninteresting directories within the search paths.
from gcovr.
@latk I really appreciate your help and your work on gcovr. Using (.+/)?mcopidl$
did the job. Thanks for the additional helpful suggestions!
from gcovr.
Related Issues (20)
- Add support to the Atlassian Clover output format HOT 17
- Decisions coverage is not printed in JSON summary HOT 3
- Update PyPi Frequency HOT 2
- `master` branch docs are out of date HOT 2
- Read configuration from `pyproject.toml` HOT 4
- UnknownLineType thrown when parsing coverage data from 10K+ line file HOT 3
- Unrecognized GCOV output in Debian Trixie HOT 1
- Gcovr fails with hyphen in path HOT 5
- Include multiple coverage reports in html with different coloring HOT 1
- pytest fails collecting with CC=x86_64-pc-linux-gnu-cc HOT 7
- Abnormal high line coverage on a function HOT 6
- "Unrecognized GCOV output" error when function tag line contains NAN
- Erroneous deprecation warning HOT 1
- Add support for GCC 14 condition coverage (MC/DC) HOT 3
- Gcovr output coverage rate does not match codecov reports rate HOT 4
- `--exclude` behavior is inconsistent HOT 16
- -j Option not avaiable in gcovr 7.1 and 7.2 HOT 4
- Error: version '408*', prefer 'B32*' HOT 2
- gcovr 7.2 package contains gcovr 3.2 binaries HOT 1
- Is it possible to add custom GCOVR_EXCL_START / END markers via --exclude-lines-by-pattern? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gcovr.