Giter Site home page Giter Site logo

Comments (2)

latk avatar latk commented on June 8, 2024 1

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.

tsondergaard avatar tsondergaard commented on June 8, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.