# CTEST\_CUSTOM\_COVERAGE\_EXCLUDE is not work

**URL:** https://discourse.cmake.org/t/ctest-custom-coverage-exclude-is-not-work/10884
**Category:** Usage
**Tags:** os:linux
**Created:** [May 22, 2024, 8:12am UTC](https://discourse.cmake.org/t/ctest-custom-coverage-exclude-is-not-work/10884 "2024-05-22T08:12:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vhext](https://discourse.cmake.org/user_avatar/discourse.cmake.org/vhext/32/4602_2.png) [@vhext](https://discourse.cmake.org/u/vhext)
#### Post date: [May 22, 2024, 8:12am UTC](https://discourse.cmake.org/t/ctest-custom-coverage-exclude-is-not-work/10884/1 "2024-05-22T08:12:40Z")

</div>

Hi everyone, I’m new to cmake, now I can run `ctest -T Coverage` to get my code coverage, then I want to exclude `./test/*.c`, so I execute `-fprofile-exclude-files= . /test/*` and added `list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE ".*test.*")` in `./build/CTestCustom.cmake`, but gcov still tries to find `./test/*.c` and returns error 5 .

---

<div class="post-metadata">

### Author: ![vhext](https://discourse.cmake.org/user_avatar/discourse.cmake.org/vhext/32/4602_2.png) [@vhext](https://discourse.cmake.org/u/vhext)
#### Post date: [May 23, 2024, 8:43am UTC](https://discourse.cmake.org/t/ctest-custom-coverage-exclude-is-not-work/10884/2 "2024-05-23T08:43:37Z")

</div>

I try delete `build/*` then it’s work 👌

so close it
