Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions extras/CatchAddTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ function(catch_discover_tests_impl)
# Speed-up reparsing by cutting away unneeded parts of JSON.
string(JSON test_listing GET "${listing_output}" "listings" "tests")
string(JSON num_tests LENGTH "${test_listing}")

# Exit early if no tests are detected
if(num_tests STREQUAL "0")
return()
endif()

# CMake's foreach-RANGE is inclusive, so we have to subtract 1
math(EXPR num_tests "${num_tests} - 1")

Expand Down