# File api and test cases

**URL:** https://discourse.cmake.org/t/file-api-and-test-cases/1408
**Category:** Development
**Created:** [June 18, 2020, 10:34pm UTC](https://discourse.cmake.org/t/file-api-and-test-cases/1408 "2020-06-18T22:34:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [June 18, 2020, 10:34pm UTC](https://discourse.cmake.org/t/file-api-and-test-cases/1408/1 "2020-06-18T22:34:37Z")

</div>

Does the file api enumerate test cases? I thought there was a change that introduced that, but I couldn’t find anything in CMake’s gitlab, so I’m probably misremembering. The main reason I’m asking is that if it does, then the `DISCOVERY_MODE` option added to `gtest_discover_tests()` in CMake 3.18 would be a potential problem - test cases wouldn’t be known at CMake generation time.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [June 19, 2020, 10:43am UTC](https://discourse.cmake.org/t/file-api-and-test-cases/1408/2 "2020-06-19T10:43:12Z")

</div>

The final set of test cases is not known until `ctest` runs. CTest now has a [`--show-only=json-v1`](https://cmake.org/cmake/help/v3.18/manual/ctest.1.html#show-as-json-object-model) option that is its equivalent to CMake’s fileapi.

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [June 19, 2020, 10:06pm UTC](https://discourse.cmake.org/t/file-api-and-test-cases/1408/3 "2020-06-19T22:06:00Z")

</div>

Ah, yes that would be what I was thinking of, thanks.
