# Customize the behavior of "ctest -T test" and "ctest -T coverage"

**URL:** https://discourse.cmake.org/t/customize-the-behavior-of-ctest-t-test-and-ctest-t-coverage/13369
**Category:** Usage
**Tags:** os:linux, os:macos
**Created:** [January 10, 2025, 5:33pm UTC](https://discourse.cmake.org/t/customize-the-behavior-of-ctest-t-test-and-ctest-t-coverage/13369 "2025-01-10T17:33:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![RichS](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/7c8e57/32.png) [@RichS](https://discourse.cmake.org/u/RichS)
#### Post date: [January 10, 2025, 5:33pm UTC](https://discourse.cmake.org/t/customize-the-behavior-of-ctest-t-test-and-ctest-t-coverage/13369/1 "2025-01-10T17:33:23Z")

</div>

Is there a way to customize what ctest does when using the “-T test” and “-T coverage” arguments?

I have a project where I would like to easily limit which tests run and normally I use labels for that as in “ctest -L nightly”. But that doesn’t seem to work in conjunction with “ctest -T test”.

This is primarily connected with the “-T coverage” use of ctest as “-T coverage” works well for GCC compilers but not for LLVM based compilers like clang. But using GCC and doing coverage over all my test suite takes several hours.

Thanks,  
Rich
