# CTest: have a file to run a subset of tests ?

**URL:** https://discourse.cmake.org/t/ctest-have-a-file-to-run-a-subset-of-tests/9341
**Category:** Usage
**Created:** [November 2, 2023, 3:00pm UTC](https://discourse.cmake.org/t/ctest-have-a-file-to-run-a-subset-of-tests/9341 "2023-11-02T15:00:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![neundorf](https://discourse.cmake.org/user_avatar/discourse.cmake.org/neundorf/32/2075_2.png) [@neundorf](https://discourse.cmake.org/u/neundorf)
#### Post date: [November 2, 2023, 3:00pm UTC](https://discourse.cmake.org/t/ctest-have-a-file-to-run-a-subset-of-tests/9341/1 "2023-11-02T15:00:43Z")

</div>

Hi,

ctest has several options to filter tests which will be executed, via regexp, via labels, by numbers.  
Is there a way to let’s say create a text file which contains per line the name of one test, and then have ctest execute just those tests ?  
This would be similar to the way --rerun-failed uses the LastTestsFailed.log, but without the test numbers, since they can change over time.  
So I could call it like:  
ctest -f MyFavouriteTests.txt

Thanks  
Alex

---

<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: [November 2, 2023, 9:22pm UTC](https://discourse.cmake.org/t/ctest-have-a-file-to-run-a-subset-of-tests/9341/2 "2023-11-02T21:22:16Z")

</div>

I don’t think such a mechanism exists today. Seems reasonable though. Can you please [file an issue](https://gitlab.kitware.com/cmake/cmake/-/issues)?
