diff options
| author | Reinhold Gschweicher | 2020-10-19 17:57:00 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-11-02 14:42:17 +0100 |
| commit | 71328bae905dd934ea3e47c8fd4d2f05a5a7cc98 (patch) | |
| tree | e94450c30d2d34df243cad93a5920ef5f1864a98 | |
| parent | ed9ef85a340d4d9b157e87c25547e3717972551f (diff) | |
| download | catch3-71328bae905dd934ea3e47c8fd4d2f05a5a7cc98.tar.gz | |
Fix CMake regex to add tests
Fix regex that requires two string arguments in the form of
TEST_CASE("a", "b") resulting in not finding TEST_CASE("a") entries.
See https://regex101.com/r/JygOND/1
Fixes: https://github.com/catchorg/Catch2/issues/2055
| -rw-r--r-- | extras/ParseAndAddCatchTests.cmake | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/extras/ParseAndAddCatchTests.cmake b/extras/ParseAndAddCatchTests.cmake index 9203f163..f4575ec8 100644 --- a/extras/ParseAndAddCatchTests.cmake +++ b/extras/ParseAndAddCatchTests.cmake @@ -108,7 +108,8 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget) ParseAndAddCatchTests_RemoveComments(Contents) # Find definition of test names - string(REGEX MATCHALL "[ \t]*(CATCH_)?(TEMPLATE_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([ \t\n]*\"[^\"]*\"[ \t\n]*,[ \t\n]*\"[^\"]*\"([^\(\)]+(\\([^\)]*\\))*)*\\)+[ \t\n]*{+[ \t]*(//[^\n]*[Tt][Ii][Mm][Ee][Oo][Uu][Tt][ \t]*[0-9]+)*" Tests "${Contents}") + # https://regex101.com/r/JygOND/1 + string(REGEX MATCHALL "[ \t]*(CATCH_)?(TEMPLATE_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([ \t\n]*\"[^\"]*\"[ \t\n]*(,[ \t\n]*\"[^\"]*\")?(,[ \t\n]*[^\,\)]*)*\\)[ \t\n]*\{+[ \t]*(//[^\n]*[Tt][Ii][Mm][Ee][Oo][Uu][Tt][ \t]*[0-9]+)*" Tests "${Contents}") if(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS AND Tests) ParseAndAddCatchTests_PrintDebugMessage("Adding ${SourceFile} to CMAKE_CONFIGURE_DEPENDS property") |