Coder Social home page Coder Social logo

Comments (2)

sergeyklay avatar sergeyklay commented on June 4, 2024

@ambroff I ran into a similar problem, especially considering the fact that I wanted to achieve the same report for Linux (lcov) and macOS (llvm-cov). This declaration at the very top level did the trick:

# Handle codecoverage
if(CODE_COVERAGE)
    # Now we can exclude the stuff that we aren't interested in from the tracefile:
    # 1) system deps; 2) tests; 3) build; 4) thridparty-code
    set(coverage_excludes EXCLUDE
        "/usr/*" "build/*" "*/build/*" "tests/*" "*/tests/*" "external/*" "*/external/*")
    add_code_coverage_all_targets(${coverage_excludes})
endif()

Then for every target I want code coverage I declare something like this:

# Add definition for foobar library.
add_library(foobar STATIC
    foobar.cpp
    another.cpp)

# ...

if(CODE_COVERAGE)
    target_code_coverage(foobar AUTO ALL)
endif()

N.B. To declare exclusion you have use globbing, not regular expressions.

from cmake-scripts.

sergeyklay avatar sergeyklay commented on June 4, 2024

I think this one can be closed due to the lack of any reaction.

from cmake-scripts.

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.