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

summaryrefslogtreecommitdiffhomepage
path: root/extras
diff options
context:
space:
mode:
authorMartin Hořeňovský2026-07-28 22:08:55 +0200
committerMartin Hořeňovský2026-08-08 00:05:18 +0200
commit4cde12851773b32fc5a0171f262e4281c8e28b01 (patch)
treecdd11d3c9c86a2a6c9ba15fdfe69fd9555ecf850 /extras
parent0b4d7a5a1696dbdfb23fccad8c50db9dc9a417ea (diff)
downloadcatch3-4cde12851773b32fc5a0171f262e4281c8e28b01.tar.gz
JSONReporter considers verbosity when listing tests
* Quiet verbosity provides just the test names * Normal verbosity adds tags * High verbosity add the source location of the tests Listing tests with the quiet verbosity results in about 1/4 of the previous output, which leads to measurably faster execution of `catch_discover_tests` when it does not need tags for labels. (If it does need tags, the output is about 1/2 of previous).
Diffstat (limited to 'extras')
-rw-r--r--extras/CatchAddTests.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/extras/CatchAddTests.cmake b/extras/CatchAddTests.cmake
index b0d8c02b..6116e4b8 100644
--- a/extras/CatchAddTests.cmake
+++ b/extras/CatchAddTests.cmake
@@ -253,10 +253,15 @@ function(catch_discover_tests_impl)
make_temp_file_path(listing_output_path "${_TEST_WORKING_DIR}")
+ set(_Verbosity "quiet")
+ if (add_tags)
+ set(_Verbosity "normal")
+ endif()
+
execute_process(
COMMAND ${_TEST_EXECUTOR} "${_TEST_EXECUTABLE}" ${spec}
--list-tests
- --reporter json
+ --reporter "json::verbosity=${_Verbosity}"
--out "${listing_output_path}"
--order lex # Make sure the output order, and thus test registration order, is consistent across runs.
OUTPUT_VARIABLE listing_output