# Adding gtest test to a CONFIGURATION

**URL:** https://discourse.cmake.org/t/adding-gtest-test-to-a-configuration/10511
**Category:** Usage
**Tags:** tool:ctest
**Created:** [March 28, 2024, 8:33am UTC](https://discourse.cmake.org/t/adding-gtest-test-to-a-configuration/10511 "2024-03-28T08:33:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![KUGA2](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kuga2/32/4968_2.png) [@KUGA2](https://discourse.cmake.org/u/KUGA2)
#### Post date: [March 28, 2024, 8:33am UTC](https://discourse.cmake.org/t/adding-gtest-test-to-a-configuration/10511/1 "2024-03-28T08:33:04Z")

</div>

Am I right, that you cannot add gtest testcase to a test configuration using `gtest_add_tests()`?

It does not have any argument for CONFIGURATION and CONFIGURATION is not a test property I can manually add.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [March 4, 2025, 9:02am UTC](https://discourse.cmake.org/t/adding-gtest-test-to-a-configuration/10511/2 "2025-03-04T09:02:23Z")

</div>

I think the project would need to do some kind of configuration-dependent source or code exclusion here. `gtest_add_tests()` (IIRC) runs the executable to discover tests of interest.
