diff options
| author | Martin Hořeňovský | 2023-03-14 23:00:59 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2023-03-20 19:24:52 +0100 |
| commit | 62167d756e13d8f053b397c07f1192d8e308f2c5 (patch) | |
| tree | 1c5ac58fe591f8b4addf0037c328efbba9798c37 /src/catch2 | |
| parent | 6783411349db5a87718c9b7ba8b02e90e39d783e (diff) | |
| download | catch3-62167d756e13d8f053b397c07f1192d8e308f2c5.tar.gz | |
Reduce internal includes
Diffstat (limited to 'src/catch2')
| -rw-r--r-- | src/catch2/internal/catch_test_case_registry_impl.cpp | 8 | ||||
| -rw-r--r-- | src/catch2/internal/catch_test_case_registry_impl.hpp | 15 | ||||
| -rw-r--r-- | src/catch2/internal/catch_test_registry.cpp | 15 |
3 files changed, 16 insertions, 22 deletions
diff --git a/src/catch2/internal/catch_test_case_registry_impl.cpp b/src/catch2/internal/catch_test_case_registry_impl.cpp index 4b3d2e47..b66469bc 100644 --- a/src/catch2/internal/catch_test_case_registry_impl.cpp +++ b/src/catch2/internal/catch_test_case_registry_impl.cpp @@ -9,6 +9,7 @@ #include <catch2/internal/catch_context.hpp> #include <catch2/internal/catch_enforce.hpp> +#include <catch2/interfaces/catch_interfaces_config.hpp> #include <catch2/interfaces/catch_interfaces_registry_hub.hpp> #include <catch2/internal/catch_random_number_generator.hpp> #include <catch2/internal/catch_run_context.hpp> @@ -142,11 +143,4 @@ namespace Catch { return m_sortedFunctions; } - - - /////////////////////////////////////////////////////////////////////////// - void TestInvokerAsFunction::invoke() const { - m_testAsFunction(); - } - } // end namespace Catch diff --git a/src/catch2/internal/catch_test_case_registry_impl.hpp b/src/catch2/internal/catch_test_case_registry_impl.hpp index 228dbb79..cc6b133f 100644 --- a/src/catch2/internal/catch_test_case_registry_impl.hpp +++ b/src/catch2/internal/catch_test_case_registry_impl.hpp @@ -8,8 +8,9 @@ #ifndef CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED #define CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED -#include <catch2/internal/catch_test_registry.hpp> +#include <catch2/interfaces/catch_interfaces_testcase.hpp> #include <catch2/interfaces/catch_interfaces_config.hpp> +#include <catch2/internal/catch_unique_ptr.hpp> #include <vector> @@ -53,18 +54,6 @@ namespace Catch { /////////////////////////////////////////////////////////////////////////// - class TestInvokerAsFunction final : public ITestInvoker { - using TestType = void(*)(); - TestType m_testAsFunction; - public: - TestInvokerAsFunction(TestType testAsFunction) noexcept: - m_testAsFunction(testAsFunction) {} - - void invoke() const override; - }; - - /////////////////////////////////////////////////////////////////////////// - } // end namespace Catch diff --git a/src/catch2/internal/catch_test_registry.cpp b/src/catch2/internal/catch_test_registry.cpp index 9769ed03..b798fb60 100644 --- a/src/catch2/internal/catch_test_registry.cpp +++ b/src/catch2/internal/catch_test_registry.cpp @@ -8,7 +8,6 @@ #include <catch2/internal/catch_test_registry.hpp> #include <catch2/internal/catch_compiler_capabilities.hpp> #include <catch2/catch_test_case_info.hpp> -#include <catch2/internal/catch_test_case_registry_impl.hpp> #include <catch2/interfaces/catch_interfaces_registry_hub.hpp> #include <catch2/internal/catch_string_manip.hpp> #include <catch2/internal/catch_move_and_forward.hpp> @@ -19,7 +18,7 @@ namespace Catch { namespace { - StringRef extractClassName( StringRef classOrMethodName ) { + static StringRef extractClassName( StringRef classOrMethodName ) { if ( !startsWith( classOrMethodName, '&' ) ) { return classOrMethodName; } @@ -46,6 +45,18 @@ namespace Catch { static_cast<std::size_t>( startIdx ), static_cast<std::size_t>( classNameSize ) ); } + + class TestInvokerAsFunction final : public ITestInvoker { + using TestType = void ( * )(); + TestType m_testAsFunction; + + public: + TestInvokerAsFunction( TestType testAsFunction ) noexcept: + m_testAsFunction( testAsFunction ) {} + + void invoke() const override { m_testAsFunction(); } + }; + } // namespace Detail::unique_ptr<ITestInvoker> makeTestInvoker( void(*testAsFunction)() ) { |