From 9aadc3a53d7208f8b44260dfef26b18671f7edd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Thu, 21 Dec 2023 18:42:40 +0100 Subject: [PATCH] Cleanup includes in sources Mainly just removes some unused includes, but sometimes the include is replaced by a smaller header instead. --- src/catch2/catch_test_case_info.cpp | 1 + src/catch2/catch_test_case_info.hpp | 3 ++- src/catch2/generators/catch_generators_random.hpp | 1 - src/catch2/interfaces/catch_interfaces_reporter.cpp | 8 -------- src/catch2/interfaces/catch_interfaces_reporter.hpp | 1 - src/catch2/internal/catch_assertion_handler.cpp | 2 -- src/catch2/internal/catch_commandline.cpp | 5 +++-- src/catch2/internal/catch_fatal_condition_handler.cpp | 1 + src/catch2/internal/catch_fatal_condition_handler.hpp | 3 --- src/catch2/internal/catch_list.cpp | 3 --- src/catch2/internal/catch_reporter_spec_parser.hpp | 2 +- src/catch2/internal/catch_section.cpp | 2 +- src/catch2/internal/catch_tag_alias_registry.cpp | 1 - src/catch2/internal/catch_test_case_registry_impl.cpp | 4 ---- src/catch2/internal/catch_uncaught_exceptions.cpp | 1 - 15 files changed, 9 insertions(+), 29 deletions(-) diff --git a/src/catch2/catch_test_case_info.cpp b/src/catch2/catch_test_case_info.cpp index e9dad57787..c38ee55acc 100644 --- a/src/catch2/catch_test_case_info.cpp +++ b/src/catch2/catch_test_case_info.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include diff --git a/src/catch2/catch_test_case_info.hpp b/src/catch2/catch_test_case_info.hpp index 5ff3e3e720..a2f4b43ecb 100644 --- a/src/catch2/catch_test_case_info.hpp +++ b/src/catch2/catch_test_case_info.hpp @@ -8,10 +8,10 @@ #ifndef CATCH_TEST_CASE_INFO_HPP_INCLUDED #define CATCH_TEST_CASE_INFO_HPP_INCLUDED +#include #include #include #include -#include #include @@ -44,6 +44,7 @@ namespace Catch { }; class ITestInvoker; + struct NameAndTags; enum class TestCaseProperties : uint8_t { None = 0, diff --git a/src/catch2/generators/catch_generators_random.hpp b/src/catch2/generators/catch_generators_random.hpp index d5f307d40c..712835619e 100644 --- a/src/catch2/generators/catch_generators_random.hpp +++ b/src/catch2/generators/catch_generators_random.hpp @@ -8,7 +8,6 @@ #ifndef CATCH_GENERATORS_RANDOM_HPP_INCLUDED #define CATCH_GENERATORS_RANDOM_HPP_INCLUDED -#include #include #include #include diff --git a/src/catch2/interfaces/catch_interfaces_reporter.cpp b/src/catch2/interfaces/catch_interfaces_reporter.cpp index 3274bcf50e..90536bb366 100644 --- a/src/catch2/interfaces/catch_interfaces_reporter.cpp +++ b/src/catch2/interfaces/catch_interfaces_reporter.cpp @@ -7,19 +7,11 @@ // SPDX-License-Identifier: BSL-1.0 #include #include -#include -#include #include -#include -#include -#include -#include #include #include -#include #include -#include namespace Catch { diff --git a/src/catch2/interfaces/catch_interfaces_reporter.hpp b/src/catch2/interfaces/catch_interfaces_reporter.hpp index b40fce3128..a052c5db1d 100644 --- a/src/catch2/interfaces/catch_interfaces_reporter.hpp +++ b/src/catch2/interfaces/catch_interfaces_reporter.hpp @@ -15,7 +15,6 @@ #include #include #include -#include #include #include diff --git a/src/catch2/internal/catch_assertion_handler.cpp b/src/catch2/internal/catch_assertion_handler.cpp index e5232f70c9..f650a7073a 100644 --- a/src/catch2/internal/catch_assertion_handler.cpp +++ b/src/catch2/internal/catch_assertion_handler.cpp @@ -8,10 +8,8 @@ #include #include #include -#include #include #include -#include #include namespace Catch { diff --git a/src/catch2/internal/catch_commandline.cpp b/src/catch2/internal/catch_commandline.cpp index 4ac1847b20..c29a801d3e 100644 --- a/src/catch2/internal/catch_commandline.cpp +++ b/src/catch2/internal/catch_commandline.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -300,8 +301,8 @@ namespace Catch { ( "split the tests to execute into this many groups" ) | Opt( setShardIndex, "shard index" ) ["--shard-index"] - ( "index of the group of tests to execute (see --shard-count)" ) | - Opt( config.allowZeroTests ) + ( "index of the group of tests to execute (see --shard-count)" ) + | Opt( config.allowZeroTests ) ["--allow-running-no-tests"] ( "Treat 'No tests run' as a success" ) | Arg( config.testsOrTags, "test name|pattern|tags" ) diff --git a/src/catch2/internal/catch_fatal_condition_handler.cpp b/src/catch2/internal/catch_fatal_condition_handler.cpp index f9702b1847..9ef5b21795 100644 --- a/src/catch2/internal/catch_fatal_condition_handler.cpp +++ b/src/catch2/internal/catch_fatal_condition_handler.cpp @@ -26,6 +26,7 @@ #include +#include #include #include #include diff --git a/src/catch2/internal/catch_fatal_condition_handler.hpp b/src/catch2/internal/catch_fatal_condition_handler.hpp index ce07f9b6a7..81728b563a 100644 --- a/src/catch2/internal/catch_fatal_condition_handler.hpp +++ b/src/catch2/internal/catch_fatal_condition_handler.hpp @@ -8,9 +8,6 @@ #ifndef CATCH_FATAL_CONDITION_HANDLER_HPP_INCLUDED #define CATCH_FATAL_CONDITION_HANDLER_HPP_INCLUDED -#include -#include - #include namespace Catch { diff --git a/src/catch2/internal/catch_list.cpp b/src/catch2/internal/catch_list.cpp index 97e4c59315..5bd06a2aef 100644 --- a/src/catch2/internal/catch_list.cpp +++ b/src/catch2/internal/catch_list.cpp @@ -14,10 +14,7 @@ #include #include #include - -#include #include -#include #include namespace Catch { diff --git a/src/catch2/internal/catch_reporter_spec_parser.hpp b/src/catch2/internal/catch_reporter_spec_parser.hpp index d446ce98b4..9f447ee2f7 100644 --- a/src/catch2/internal/catch_reporter_spec_parser.hpp +++ b/src/catch2/internal/catch_reporter_spec_parser.hpp @@ -8,7 +8,7 @@ #ifndef CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED #define CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED -#include +#include #include #include diff --git a/src/catch2/internal/catch_section.cpp b/src/catch2/internal/catch_section.cpp index 061732b1d8..677c2164c2 100644 --- a/src/catch2/internal/catch_section.cpp +++ b/src/catch2/internal/catch_section.cpp @@ -6,7 +6,7 @@ // SPDX-License-Identifier: BSL-1.0 #include -#include +#include #include #include diff --git a/src/catch2/internal/catch_tag_alias_registry.cpp b/src/catch2/internal/catch_tag_alias_registry.cpp index 4fd0d55798..510df167f9 100644 --- a/src/catch2/internal/catch_tag_alias_registry.cpp +++ b/src/catch2/internal/catch_tag_alias_registry.cpp @@ -6,7 +6,6 @@ // SPDX-License-Identifier: BSL-1.0 #include -#include #include #include #include diff --git a/src/catch2/internal/catch_test_case_registry_impl.cpp b/src/catch2/internal/catch_test_case_registry_impl.cpp index f1702979e7..c2b052daf7 100644 --- a/src/catch2/internal/catch_test_case_registry_impl.cpp +++ b/src/catch2/internal/catch_test_case_registry_impl.cpp @@ -7,12 +7,9 @@ // SPDX-License-Identifier: BSL-1.0 #include -#include #include #include #include -#include -#include #include #include #include @@ -73,7 +70,6 @@ namespace Catch { return sorted; } case TestRunOrder::Randomized: { - seedRng(config); using TestWithHash = std::pair; TestCaseInfoHasher h{ config.rngSeed() }; diff --git a/src/catch2/internal/catch_uncaught_exceptions.cpp b/src/catch2/internal/catch_uncaught_exceptions.cpp index 704d6e1ca9..8cfabc0f8b 100644 --- a/src/catch2/internal/catch_uncaught_exceptions.cpp +++ b/src/catch2/internal/catch_uncaught_exceptions.cpp @@ -7,7 +7,6 @@ // SPDX-License-Identifier: BSL-1.0 #include -#include #include #include