Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor asap_add_code_coverage_all_targets to add standard excluded directories by default #8

Closed
abdes opened this issue Aug 10, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@abdes
Copy link
Owner

abdes commented Aug 10, 2022

Rather than exclude patterns such as test files, system includes, and third party dependencies added by CPM in the master CMakeLists.txt, these standard excludes should be automatically added.

  function(asap_add_code_coverage_all_targets)
    # Add standard exclusion patterns for code coverage reports
    if("${CMAKE_C_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
      # For clang we'll be using llvm-cov which expect regex as input for
      # exclusions
      set(STANDARD_EXCLUDES '.*/test/.*' '.*/\.cache/CPM/.*' '/usr/.*')
    else()
      # For GNU however, we'll be using lcov which expects file patterns as
      # input for excludions
      set(STANDARD_EXCLUDES */test/* */.cache/CPM/* /usr/*)
    endif()
    add_code_coverage_all_targets(EXCLUDE ${STANDARD_EXCLUDES} ${ARGV})
  endfunction()
@abdes abdes added the enhancement New feature or request label Aug 10, 2022
@abdes abdes self-assigned this Aug 10, 2022
@abdes abdes closed this as completed Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant