From ddd0e7218d884fca75dc2e6413ccb94851b3f264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Tue, 28 Jan 2020 20:48:32 +0100 Subject: [PATCH] Remove the !hide special tag --- docs/cmake-integration.md | 2 +- docs/release-notes.md | 2 ++ docs/test-cases-and-sections.md | 2 +- src/catch2/catch_test_case_info.cpp | 3 +-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/cmake-integration.md b/docs/cmake-integration.md index 57073c40..6ae798db 100644 --- a/docs/cmake-integration.md +++ b/docs/cmake-integration.md @@ -160,7 +160,7 @@ ParseAndAddCatchTests(foo) * `PARSE_CATCH_TESTS_VERBOSE` -- When `ON`, the script prints debug messages. Defaults to `OFF`. * `PARSE_CATCH_TESTS_NO_HIDDEN_TESTS` -- When `ON`, hidden tests (tests -tagged with any of `[!hide]`, `[.]` or `[.foo]`) will not be registered. +tagged with either of `[.]` or `[.foo]`) will not be registered. Defaults to `OFF`. * `PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME` -- When `ON`, adds fixture class name to the test name in CTest. Defaults to `ON`. diff --git a/docs/release-notes.md b/docs/release-notes.md index de6fe30b..baf34a2d 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -49,6 +49,8 @@ * `SectionInfo` no longer contains section description as a member (#1319) * You can still write `SECTION("ShortName", "Long and wordy description")`, but the description is thrown away * The description type now must be a `const char*` or implicitly convertible to it +* The `[!hide]` tag has been removed. + * Use `[.]` or `[.foo]` instead. ### Fixes * The `INFO` macro no longer contains superfluous semicolon (#1456) diff --git a/docs/test-cases-and-sections.md b/docs/test-cases-and-sections.md index c30f9f50..e9308c5e 100644 --- a/docs/test-cases-and-sections.md +++ b/docs/test-cases-and-sections.md @@ -50,7 +50,7 @@ Tag names are not case sensitive and can contain any ASCII characters. This mean All tag names beginning with non-alphanumeric characters are reserved by Catch. Catch defines a number of "special" tags, which have meaning to the test runner itself. These special tags all begin with a symbol character. Following is a list of currently defined special tags and their meanings. -* `[!hide]` or `[.]` - causes test cases to be skipped from the default list (i.e. when no test cases have been explicitly selected through tag expressions or name wildcards). The hide tag is often combined with another, user, tag (for example `[.][integration]` - so all integration tests are excluded from the default run but can be run by passing `[integration]` on the command line). As a short-cut you can combine these by simply prefixing your user tag with a `.` - e.g. `[.integration]`. Because the hide tag has evolved to have several forms, all forms are added as tags if you use one of them. +* `[.]` - causes test cases to be skipped from the default list (i.e. when no test cases have been explicitly selected through tag expressions or name wildcards). The hide tag is often combined with another, user, tag (for example `[.][integration]` - so all integration tests are excluded from the default run but can be run by passing `[integration]` on the command line). As a short-cut you can combine these by simply prefixing your user tag with a `.` - e.g. `[.integration]`. * `[!throws]` - lets Catch know that this test is likely to throw an exception even if successful. This causes the test to be excluded when running with `-e` or `--nothrow`. diff --git a/src/catch2/catch_test_case_info.cpp b/src/catch2/catch_test_case_info.cpp index 15519dc9..c4e1416a 100644 --- a/src/catch2/catch_test_case_info.cpp +++ b/src/catch2/catch_test_case_info.cpp @@ -50,8 +50,7 @@ namespace Catch { } TestCaseProperties parseSpecialTag( StringRef tag ) { - if( (!tag.empty() && tag[0] == '.') - || tag == "!hide"_sr ) + if( !tag.empty() && tag[0] == '.' ) return TestCaseProperties::IsHidden; else if( tag == "!throws"_sr ) return TestCaseProperties::Throws;