Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Remove --list-test-names-only

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

Closes #1190
Commit
c582e351ce8420cc74c84abf0a797a3663bf06ea
Author
Martin Hořeňovský ·
Parents
d2cddfc9c5e1

Files · Download .tar.gz

Changes

 docs/deprecations.md                   | 12 ------------
 docs/release-notes.md                  |  5 ++++-
 include/internal/catch_commandline.cpp |  3 ---
 include/internal/catch_config.cpp      |  1 -
 include/internal/catch_config.hpp      |  2 --
 include/internal/catch_list.cpp        | 20 --------------------
 projects/CMakeLists.txt                |  6 ------
 7 files changed, 4 insertions(+), 45 deletions(-)

diff --git a/docs/deprecations.md b/docs/deprecations.md
index bf7a71fa..42f7a073 100644
--- a/docs/deprecations.md
+++ b/docs/deprecations.md
@@ -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
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 05959617..cb389512 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -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)
diff --git a/include/internal/catch_commandline.cpp b/include/internal/catch_commandline.cpp
index 365a3c9d..0008c577 100644
--- a/include/internal/catch_commandline.cpp
+++ b/include/internal/catch_commandline.cpp
@@ -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" )
diff --git a/include/internal/catch_config.cpp b/include/internal/catch_config.cpp
index e222328b..6a5e5f38 100644
--- a/include/internal/catch_config.cpp
+++ b/include/internal/catch_config.cpp
@@ -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; }
 
diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp
index 95b67d25..2074d933 100644
--- a/include/internal/catch_config.hpp
+++ b/include/internal/catch_config.hpp
@@ -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;
 
diff --git a/include/internal/catch_list.cpp b/include/internal/catch_list.cpp
index f8b3503f..7a1ae7d9 100644
--- a/include/internal/catch_list.cpp
+++ b/include/internal/catch_list.cpp
@@ -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);
diff --git a/projects/CMakeLists.txt b/projects/CMakeLists.txt
index e0e7b63e..d3556cee 100644
--- a/projects/CMakeLists.txt
+++ b/projects/CMakeLists.txt
@@ -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)