From c742ea9ad97a34c8f652dd7f67012d5b3f818c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Thu, 14 Apr 2022 17:16:01 +0200 Subject: [PATCH] Some IWYU include cleanups --- src/catch2/benchmark/detail/catch_stats.cpp | 1 + src/catch2/catch_approx.cpp | 1 + src/catch2/catch_config.cpp | 2 -- src/catch2/catch_config.hpp | 7 ++++--- src/catch2/catch_test_case_info.cpp | 2 -- src/catch2/catch_totals.hpp | 1 - src/catch2/internal/catch_assertion_handler.hpp | 4 ++-- src/catch2/internal/catch_case_insensitive_comparisons.hpp | 2 -- src/catch2/internal/catch_clara.cpp | 5 ++++- src/catch2/internal/catch_clara.hpp | 1 - src/catch2/internal/catch_commandline.cpp | 2 -- src/catch2/internal/catch_console_colour.cpp | 3 +++ src/catch2/internal/catch_console_colour.hpp | 1 - src/catch2/internal/catch_debug_console.cpp | 2 ++ src/catch2/internal/catch_reporter_spec_parser.cpp | 1 - src/catch2/internal/catch_tag_alias_registry.hpp | 1 + src/catch2/internal/catch_xmlwriter.hpp | 1 + src/catch2/reporters/catch_reporter_automake.hpp | 2 ++ src/catch2/reporters/catch_reporter_cumulative_base.cpp | 2 ++ src/catch2/reporters/catch_reporter_cumulative_base.hpp | 1 - src/catch2/reporters/catch_reporter_multi.cpp | 2 -- src/catch2/reporters/catch_reporter_streaming_base.hpp | 2 -- src/catch2/reporters/catch_reporter_tap.cpp | 1 + src/catch2/reporters/catch_reporter_teamcity.cpp | 1 + tests/ExtraTests/X05-DeferredStaticChecks.cpp | 1 - 25 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/catch2/benchmark/detail/catch_stats.cpp b/src/catch2/benchmark/detail/catch_stats.cpp index 0f94d5b7..10511d4c 100644 --- a/src/catch2/benchmark/detail/catch_stats.cpp +++ b/src/catch2/benchmark/detail/catch_stats.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include diff --git a/src/catch2/catch_approx.cpp b/src/catch2/catch_approx.cpp index 50cb75c3..21652111 100644 --- a/src/catch2/catch_approx.cpp +++ b/src/catch2/catch_approx.cpp @@ -7,6 +7,7 @@ // SPDX-License-Identifier: BSL-1.0 #include #include +#include #include #include diff --git a/src/catch2/catch_config.cpp b/src/catch2/catch_config.cpp index 79ec33f8..7363ee70 100644 --- a/src/catch2/catch_config.cpp +++ b/src/catch2/catch_config.cpp @@ -14,8 +14,6 @@ #include #include -#include - namespace Catch { bool operator==( ProcessedReporterSpec const& lhs, diff --git a/src/catch2/catch_config.hpp b/src/catch2/catch_config.hpp index 2b57bbb5..8823accd 100644 --- a/src/catch2/catch_config.hpp +++ b/src/catch2/catch_config.hpp @@ -9,16 +9,17 @@ #define CATCH_CONFIG_HPP_INCLUDED #include -#include #include #include #include +#include #include #include -#include -#include +#include +#include #include +#include namespace Catch { diff --git a/src/catch2/catch_test_case_info.cpp b/src/catch2/catch_test_case_info.cpp index 83cfcc8e..6d89dc72 100644 --- a/src/catch2/catch_test_case_info.cpp +++ b/src/catch2/catch_test_case_info.cpp @@ -7,8 +7,6 @@ // SPDX-License-Identifier: BSL-1.0 #include #include -#include -#include #include #include diff --git a/src/catch2/catch_totals.hpp b/src/catch2/catch_totals.hpp index 7ab6a1b6..6bc444fc 100644 --- a/src/catch2/catch_totals.hpp +++ b/src/catch2/catch_totals.hpp @@ -8,7 +8,6 @@ #ifndef CATCH_TOTALS_HPP_INCLUDED #define CATCH_TOTALS_HPP_INCLUDED -#include #include namespace Catch { diff --git a/src/catch2/internal/catch_assertion_handler.hpp b/src/catch2/internal/catch_assertion_handler.hpp index 4d397766..5faa5e4b 100644 --- a/src/catch2/internal/catch_assertion_handler.hpp +++ b/src/catch2/internal/catch_assertion_handler.hpp @@ -13,11 +13,11 @@ #include #include +#include + namespace Catch { - struct AssertionResultData; class IResultCapture; - class RunContext; struct AssertionReaction { bool shouldDebugBreak = false; diff --git a/src/catch2/internal/catch_case_insensitive_comparisons.hpp b/src/catch2/internal/catch_case_insensitive_comparisons.hpp index 5742e6b7..c182e13e 100644 --- a/src/catch2/internal/catch_case_insensitive_comparisons.hpp +++ b/src/catch2/internal/catch_case_insensitive_comparisons.hpp @@ -10,8 +10,6 @@ #include -#include - namespace Catch { namespace Detail { //! Provides case-insensitive `op<` semantics when called diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp index df844838..a4701a81 100644 --- a/src/catch2/internal/catch_clara.cpp +++ b/src/catch2/internal/catch_clara.cpp @@ -5,13 +5,16 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -#include + #include #include #include #include #include +#include +#include + namespace { bool isOptPrefix( char c ) { return c == '-' diff --git a/src/catch2/internal/catch_clara.hpp b/src/catch2/internal/catch_clara.hpp index 00761c0a..0d3fb233 100644 --- a/src/catch2/internal/catch_clara.hpp +++ b/src/catch2/internal/catch_clara.hpp @@ -34,7 +34,6 @@ #include #include -#include #include #include #include diff --git a/src/catch2/internal/catch_commandline.cpp b/src/catch2/internal/catch_commandline.cpp index d16e7e37..59b06de9 100644 --- a/src/catch2/internal/catch_commandline.cpp +++ b/src/catch2/internal/catch_commandline.cpp @@ -12,11 +12,9 @@ #include #include #include -#include #include #include -#include #include #include diff --git a/src/catch2/internal/catch_console_colour.cpp b/src/catch2/internal/catch_console_colour.cpp index e9fa55f7..7f202490 100644 --- a/src/catch2/internal/catch_console_colour.cpp +++ b/src/catch2/internal/catch_console_colour.cpp @@ -16,13 +16,16 @@ #include #include #include +#include #include #include #include #include #include +#include #include +#include namespace Catch { diff --git a/src/catch2/internal/catch_console_colour.hpp b/src/catch2/internal/catch_console_colour.hpp index 661078af..aa3d83a2 100644 --- a/src/catch2/internal/catch_console_colour.hpp +++ b/src/catch2/internal/catch_console_colour.hpp @@ -16,7 +16,6 @@ namespace Catch { enum class ColourMode : std::uint8_t; - class IConfig; class IStream; struct Colour { diff --git a/src/catch2/internal/catch_debug_console.cpp b/src/catch2/internal/catch_debug_console.cpp index 5942524e..d13cc0bb 100644 --- a/src/catch2/internal/catch_debug_console.cpp +++ b/src/catch2/internal/catch_debug_console.cpp @@ -11,6 +11,8 @@ #include #include +#include + #if defined(CATCH_CONFIG_ANDROID_LOGWRITE) #include diff --git a/src/catch2/internal/catch_reporter_spec_parser.cpp b/src/catch2/internal/catch_reporter_spec_parser.cpp index 378a6f5a..28b2088a 100644 --- a/src/catch2/internal/catch_reporter_spec_parser.cpp +++ b/src/catch2/internal/catch_reporter_spec_parser.cpp @@ -12,7 +12,6 @@ #include #include -#include namespace Catch { diff --git a/src/catch2/internal/catch_tag_alias_registry.hpp b/src/catch2/internal/catch_tag_alias_registry.hpp index 9dd86c13..3dbe0528 100644 --- a/src/catch2/internal/catch_tag_alias_registry.hpp +++ b/src/catch2/internal/catch_tag_alias_registry.hpp @@ -15,6 +15,7 @@ #include namespace Catch { + struct SourceLineInfo; class TagAliasRegistry : public ITagAliasRegistry { public: diff --git a/src/catch2/internal/catch_xmlwriter.hpp b/src/catch2/internal/catch_xmlwriter.hpp index 5be8277d..edeb64a2 100644 --- a/src/catch2/internal/catch_xmlwriter.hpp +++ b/src/catch2/internal/catch_xmlwriter.hpp @@ -11,6 +11,7 @@ #include #include +#include #include namespace Catch { diff --git a/src/catch2/reporters/catch_reporter_automake.hpp b/src/catch2/reporters/catch_reporter_automake.hpp index c544f337..cd85e6bf 100644 --- a/src/catch2/reporters/catch_reporter_automake.hpp +++ b/src/catch2/reporters/catch_reporter_automake.hpp @@ -10,6 +10,8 @@ #include +#include + namespace Catch { class AutomakeReporter final : public StreamingReporterBase { diff --git a/src/catch2/reporters/catch_reporter_cumulative_base.cpp b/src/catch2/reporters/catch_reporter_cumulative_base.cpp index b52ba7ef..957880d0 100644 --- a/src/catch2/reporters/catch_reporter_cumulative_base.cpp +++ b/src/catch2/reporters/catch_reporter_cumulative_base.cpp @@ -7,6 +7,8 @@ // SPDX-License-Identifier: BSL-1.0 #include +#include + #include #include diff --git a/src/catch2/reporters/catch_reporter_cumulative_base.hpp b/src/catch2/reporters/catch_reporter_cumulative_base.hpp index d43ca479..742eaac9 100644 --- a/src/catch2/reporters/catch_reporter_cumulative_base.hpp +++ b/src/catch2/reporters/catch_reporter_cumulative_base.hpp @@ -12,7 +12,6 @@ #include #include -#include #include #include diff --git a/src/catch2/reporters/catch_reporter_multi.cpp b/src/catch2/reporters/catch_reporter_multi.cpp index 86d39d6a..e8cf7bdf 100644 --- a/src/catch2/reporters/catch_reporter_multi.cpp +++ b/src/catch2/reporters/catch_reporter_multi.cpp @@ -11,8 +11,6 @@ #include #include -#include - namespace Catch { void MultiReporter::updatePreferences(IEventListener const& reporterish) { m_preferences.shouldRedirectStdOut |= diff --git a/src/catch2/reporters/catch_reporter_streaming_base.hpp b/src/catch2/reporters/catch_reporter_streaming_base.hpp index afa67d76..5088bd0b 100644 --- a/src/catch2/reporters/catch_reporter_streaming_base.hpp +++ b/src/catch2/reporters/catch_reporter_streaming_base.hpp @@ -10,8 +10,6 @@ #include -#include -#include #include namespace Catch { diff --git a/src/catch2/reporters/catch_reporter_tap.cpp b/src/catch2/reporters/catch_reporter_tap.cpp index 4cc91b7b..71249f87 100644 --- a/src/catch2/reporters/catch_reporter_tap.cpp +++ b/src/catch2/reporters/catch_reporter_tap.cpp @@ -11,6 +11,7 @@ #include #include +#include #include namespace Catch { diff --git a/src/catch2/reporters/catch_reporter_teamcity.cpp b/src/catch2/reporters/catch_reporter_teamcity.cpp index 8f16757a..142dffbb 100644 --- a/src/catch2/reporters/catch_reporter_teamcity.cpp +++ b/src/catch2/reporters/catch_reporter_teamcity.cpp @@ -14,6 +14,7 @@ #include #include +#include namespace Catch { diff --git a/tests/ExtraTests/X05-DeferredStaticChecks.cpp b/tests/ExtraTests/X05-DeferredStaticChecks.cpp index a09ed1cc..62ceb4a7 100644 --- a/tests/ExtraTests/X05-DeferredStaticChecks.cpp +++ b/tests/ExtraTests/X05-DeferredStaticChecks.cpp @@ -12,7 +12,6 @@ */ #include -#include TEST_CASE("Deferred static checks") { STATIC_CHECK(1 == 2);