[CMake]Optimize JSON parsing in catch_discover_tests()#3169
Merged
horenmar merged 1 commit intoJul 8, 2026
Merged
Conversation
a237543 to
3dc07b0
Compare
3dc07b0 to
6c2b6b9
Compare
TheStormN
commented
Jul 7, 2026
Comment on lines
+202
to
+208
| 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() |
Contributor
Author
There was a problem hiding this comment.
In short if add_tags is false we do only a single round of parsing the JSON data. Unfortunately if tags are used as labels, the performance will be as before.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #3169 +/- ##
=======================================
Coverage 91.12% 91.12%
=======================================
Files 204 204
Lines 8922 8922
=======================================
Hits 8130 8130
Misses 792 792 🚀 New features to boost your workflow:
|
Member
|
Sure, why not. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Optimizes the CMake JSON parsing logic in
catch_discover_tests()by avoiding materialization of full per-test JSON object whenADD_TAGS_AS_LABELSis not used.GitHub Issues
Closes #3168