Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/extras/CatchAddTests.cmake
diff options
context:
space:
mode:
authorNikolay Baklicharov2026-07-08 00:29:51 +0300
committerMartin Hořeňovský2026-07-08 10:29:59 +0200
commita15f718c825b29d009c98e0770c35646332217c1 (patch)
tree58ba3276635f385cea560d5c007cec92a4aae72b /extras/CatchAddTests.cmake
parent191fa38c9b1596cd2576ab531d4ab4d5e8e05190 (diff)
downloadcatch3-a15f718c825b29d009c98e0770c35646332217c1.tar.gz
Optimize JSON parsing in catch_discover_tests()
Diffstat (limited to 'extras/CatchAddTests.cmake')
-rw-r--r--extras/CatchAddTests.cmake10
1 files changed, 7 insertions, 3 deletions
diff --git a/extras/CatchAddTests.cmake b/extras/CatchAddTests.cmake
index be3d1c8c..1f6cf9b0 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.