Skip to content

Commit

Permalink
Add deprecation warning in ParseAndCatchTests
Browse files Browse the repository at this point in the history
Parsing C++ with regex in CMake is error prone and regularly leads to silently
dropped (not run) test cases.

Going forward the function `catch_discover_tests` from `contrib/CMake.cmake`
should be used.

For more information see catchorg#2092 (comment)
  • Loading branch information
NeroBurner committed Dec 17, 2020
1 parent fac517d commit 6e12e9f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions contrib/ParseAndAddCatchTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ endfunction()

# entry point
function(ParseAndAddCatchTests TestTarget)
message(DEPRECATION "ParseAndAddCatchTest: function deprecated because of possibility of missed test cases. Consider using 'catch_discover_tests' from 'Catch.cmake'")
ParseAndAddCatchTests_PrintDebugMessage("Started parsing ${TestTarget}")
get_target_property(SourceFiles ${TestTarget} SOURCES)
ParseAndAddCatchTests_PrintDebugMessage("Found the following sources: ${SourceFiles}")
Expand Down

0 comments on commit 6e12e9f

Please sign in to comment.