diff --git a/docs/logging.md b/docs/logging.md index 423ce6a878..f6ad81a353 100644 --- a/docs/logging.md +++ b/docs/logging.md @@ -45,6 +45,9 @@ These macros come in three forms: The message is logged to a buffer, but only reported with the next assertion that is logged. This allows you to log contextual information in case of failures which is not shown during a successful test run (for the console reporter, without -s). Messages are removed from the buffer at the end of their scope, so may be used, for example, in loops. +_Note that in Catch2 2.x.x `INFO` can be used without a trailing semicolon as there is a trailing semicolon inside macro. +This semicolon will be removed with next major version. It is highly advised to use a trailing semicolon after `INFO` macro._ + **WARN(** _message expression_ **)** The message is always reported but does not fail the test. diff --git a/examples/210-Evt-EventListeners.cpp b/examples/210-Evt-EventListeners.cpp index 7df93d715b..fde51c7ea1 100644 --- a/examples/210-Evt-EventListeners.cpp +++ b/examples/210-Evt-EventListeners.cpp @@ -387,16 +387,16 @@ TEST_CASE( "2: Testcase with sections", "[tag-A][tag-B]" ) { REQUIRE( i == 42 ); SECTION("Section 1") { - INFO("Section 1") + INFO("Section 1"); i = 7; SECTION("Section 1.1") { - INFO("Section 1.1") + INFO("Section 1.1"); REQUIRE( i == 42 ); } } SECTION("Section 2") { - INFO("Section 2") + INFO("Section 2"); REQUIRE( i == 42 ); } WARN("At end of test case");