Skip to content

Commit

Permalink
Remove the !hide special tag
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed Jan 28, 2020
1 parent 49e000b commit ddd0e72
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/cmake-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 2 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/test-cases-and-sections.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
3 changes: 1 addition & 2 deletions src/catch2/catch_test_case_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ddd0e72

Please sign in to comment.