Skip to content

Commit

Permalink
Remove --list-test-names-only
Browse files Browse the repository at this point in the history
People should use verbosity modifiers with `--list-tests` instead.

Closes #1190
  • Loading branch information
horenmar committed Oct 28, 2019
1 parent 2c06ee9 commit d96f6fc
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 45 deletions.
12 changes: 0 additions & 12 deletions docs/deprecations.md
Expand Up @@ -11,18 +11,6 @@ at least the next major release.

## Deprecations

### `--list-*` return values

The return codes of the `--list-*` family of command line arguments
will no longer be equal to the number of tests/tags/etc found, instead
it will be 0 for success and non-zero for failure.


### `--list-test-names-only`

`--list-test-names-only` command line argument will be removed.


### Secondary description amongst tags

Currently, the tags part of `TEST_CASE` (and others) macro can also
Expand Down
5 changes: 4 additions & 1 deletion docs/release-notes.md
Expand Up @@ -32,8 +32,11 @@

## 3.0.0 (in progress)

### Breaking changes
### (Potentially) Breaking changes
* `ANON_TEST_CASE` has been removed, use `TEST_CASE` with no arguments instead (#1220)
* `--list*` commands no longer have non-zero return code (#1410)
* `--list-test-names-only` has been removed (#1190)
* You should use verbosity-modifiers for `--list-tests` instead

### Fixes
* The `INFO` macro no longer contains superfluous semicolon (#1456)
Expand Down
3 changes: 0 additions & 3 deletions include/internal/catch_commandline.cpp
Expand Up @@ -181,9 +181,6 @@ namespace Catch {
| Opt( setVerbosity, "quiet|normal|high" )
["-v"]["--verbosity"]
( "set output verbosity" )
| Opt( config.listTestNamesOnly )
["--list-test-names-only"]
( "list all/matching test cases names only" )
| Opt( config.listReporters )
["--list-reporters"]
( "list all reporters" )
Expand Down
1 change: 0 additions & 1 deletion include/internal/catch_config.cpp
Expand Up @@ -41,7 +41,6 @@ namespace Catch {
}

bool Config::listTests() const { return m_data.listTests; }
bool Config::listTestNamesOnly() const { return m_data.listTestNamesOnly; }
bool Config::listTags() const { return m_data.listTags; }
bool Config::listReporters() const { return m_data.listReporters; }

Expand Down
2 changes: 0 additions & 2 deletions include/internal/catch_config.hpp
Expand Up @@ -30,7 +30,6 @@ namespace Catch {
bool listTests = false;
bool listTags = false;
bool listReporters = false;
bool listTestNamesOnly = false;

bool showSuccessfulTests = false;
bool shouldDebugBreak = false;
Expand Down Expand Up @@ -79,7 +78,6 @@ namespace Catch {
std::string const& getFilename() const;

bool listTests() const;
bool listTestNamesOnly() const;
bool listTags() const;
bool listReporters() const;

Expand Down
20 changes: 0 additions & 20 deletions include/internal/catch_list.cpp
Expand Up @@ -71,22 +71,6 @@ namespace Catch {
Catch::cout() << pluralise(matchedTestCases.size(), "matching test case") << '\n' << std::endl;
}

void listTestsNamesOnly(Config const& config) {
TestSpec testSpec = config.testSpec();
std::size_t matchedTests = 0;
std::vector<TestCase> matchedTestCases = filterTests(getAllTestCasesSorted(config), testSpec, config);
for (auto const& testCaseInfo : matchedTestCases) {
matchedTests++;
if (startsWith(testCaseInfo.name, '#'))
Catch::cout() << '"' << testCaseInfo.name << '"';
else
Catch::cout() << testCaseInfo.name;
if (config.verbosity() >= Verbosity::High)
Catch::cout() << "\t@" << testCaseInfo.lineInfo;
Catch::cout() << std::endl;
}
}

void listTags(Config const& config) {
TestSpec testSpec = config.testSpec();
if (config.hasTestFilters())
Expand Down Expand Up @@ -172,10 +156,6 @@ namespace Catch {
listed = true;
listTests(*config);
}
if (config->listTestNamesOnly()) {
listed = true;
listTestsNamesOnly(*config);
}
if (config->listTags()) {
listed = true;
listTags(*config);
Expand Down
6 changes: 0 additions & 6 deletions projects/CMakeLists.txt
Expand Up @@ -396,12 +396,6 @@ add_test(NAME List::Reporters::Output COMMAND $<TARGET_FILE:SelfTest> --list-rep
set_tests_properties(List::Reporters::Output PROPERTIES PASS_REGULAR_EXPRESSION "Available reporters:")
add_test(NAME List::Reporters::ExitCode COMMAND $<TARGET_FILE:SelfTest> --list-reporters)

add_test(NAME List::Tests::NamesOnly::Output COMMAND $<TARGET_FILE:SelfTest> --list-test-names-only)
set_tests_properties(List::Tests::NamesOnly::Output PROPERTIES
PASS_REGULAR_EXPRESSION "Regex string matcher"
FAIL_REGULAR_EXPRESSION "Hidden Test")
add_test(NAME List::Tests::NamesOnly::ExitCode COMMAND $<TARGET_FILE:SelfTest> --list-test-names-only)



add_test(NAME NoAssertions COMMAND $<TARGET_FILE:SelfTest> -w NoAssertions)
Expand Down

0 comments on commit d96f6fc

Please sign in to comment.