From 9aa9e31510150d43c6ebcf4edae68be79b13de92 Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Sat, 4 Apr 2026 16:39:11 -0700 Subject: [PATCH] cmake: Allow Catch test discovery Allows individual unit-tests to be discovered, tested, and debugged by IDEs without having to run _all_ of the unit-tests just to debug one specific test. --- externals/CMakeLists.txt | 1 + src/tests/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 2ee7018a3..4996b2dd0 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -60,6 +60,7 @@ if (ENABLE_TESTS) add_subdirectory(catch2) endif() target_link_libraries(catch2 INTERFACE Catch2::Catch2WithMain) + include(Catch) endif() # Crypto++ diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index f248ece4b..256a7db57 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -31,6 +31,7 @@ if (ENABLE_LIBRETRO) endif() add_test(NAME tests COMMAND tests) +catch_discover_tests(tests) if (CITRA_USE_PRECOMPILED_HEADERS) target_precompile_headers(tests PRIVATE precompiled_headers.h)