From 6c2b6b9a55de9404a7339a81e4aa2525fd33e2f8 Mon Sep 17 00:00:00 2001 From: Nikolay Baklicharov Date: Wed, 8 Jul 2026 00:29:51 +0300 Subject: [PATCH] Optimize JSON parsing in catch_discover_tests() --- extras/CatchAddTests.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/extras/CatchAddTests.cmake b/extras/CatchAddTests.cmake index be3d1c8c31..1f6cf9b043 100644 --- a/extras/CatchAddTests.cmake +++ b/extras/CatchAddTests.cmake @@ -199,9 +199,13 @@ function(catch_discover_tests_impl) math(EXPR num_tests "${num_tests} - 1") foreach(idx RANGE ${num_tests}) - string(JSON single_test GET ${test_listing} ${idx}) - string(JSON test_tags GET "${single_test}" "tags") - string(JSON plain_name GET "${single_test}" "name") + if(add_tags) + string(JSON single_test GET "${test_listing}" ${idx}) + string(JSON test_tags GET "${single_test}" "tags") + string(JSON plain_name GET "${single_test}" "name") + else() + string(JSON plain_name GET "${test_listing}" ${idx} "name") + endif() # Escape characters in test case names that would be parsed by Catch2 # Note that the \ escaping must happen FIRST! Do not change the order.