Remove --list-test-names-only

People should use verbosity modifiers with `--list-tests` instead.

Closes #1190
This commit is contained in:
Martin Hořeňovský
2019-06-16 19:27:06 +02:00
parent d2cddfc9c5
commit c582e351ce
7 changed files with 4 additions and 45 deletions

View File

@@ -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" )

View File

@@ -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; }

View File

@@ -30,7 +30,6 @@ namespace Catch {
bool listTests = false;
bool listTags = false;
bool listReporters = false;
bool listTestNamesOnly = false;
bool showSuccessfulTests = false;
bool shouldDebugBreak = false;
@@ -79,7 +78,6 @@ namespace Catch {
std::string const& getFilename() const;
bool listTests() const;
bool listTestNamesOnly() const;
bool listTags() const;
bool listReporters() const;

View File

@@ -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())
@@ -172,10 +156,6 @@ namespace Catch {
listed = true;
listTests(*config);
}
if (config->listTestNamesOnly()) {
listed = true;
listTestsNamesOnly(*config);
}
if (config->listTags()) {
listed = true;
listTags(*config);