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

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-02-21 17:29:18 +0100
committerMartin Hořeňovský2020-02-21 23:10:01 +0100
commit3bb9fcd916ecd4a78d1b8bd4c03b0e37115b2532 (patch)
tree2e306b27a7936dbe7fbe9d2daeb61b22fd0738e7
parentc3013a62519f099c3556e090a396a7a4bda11478 (diff)
downloadcatch3-3bb9fcd916ecd4a78d1b8bd4c03b0e37115b2532.tar.gz
Remove trailing semi in REGISTER_TEST_CASE
-rw-r--r--docs/release-notes.md2
-rw-r--r--src/catch2/catch_test_registry.h10
2 files changed, 8 insertions, 4 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index ae06c9e7..113d54e7 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -54,6 +54,8 @@
* The `[!hide]` tag has been removed.
* Use `[.]` or `[.foo]` instead.
* Lvalues of composed matchers cannot be composed further
+* Uses of `REGISTER_TEST_CASE` macro need to be followed by a semicolon
+ * This does not change `TEST_CASE` and friends in any way
### Fixes
* The `INFO` macro no longer contains superfluous semicolon (#1456)
diff --git a/src/catch2/catch_test_registry.h b/src/catch2/catch_test_registry.h
index bca9bb5d..3c2c5386 100644
--- a/src/catch2/catch_test_registry.h
+++ b/src/catch2/catch_test_registry.h
@@ -140,10 +140,12 @@ struct AutoReg : NonCopyable {
///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( Function ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
+ do { \
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( Function ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
+ } while(false)
///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE_2(TestName, TestFunc, Name, Tags, Signature, ... )\