diff options
| author | Martin Hořeňovský | 2023-03-31 10:44:29 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2023-03-31 19:31:51 +0200 |
| commit | 9f08097f55eb29a61efcdb4af41952a67e155215 (patch) | |
| tree | 04a4e437ee8384da04758380abe3d925ecbf79b1 /src/catch2/internal | |
| parent | 1f881ab4641b866304b818a063164dae976dba5f (diff) | |
| download | catch3-9f08097f55eb29a61efcdb4af41952a67e155215.tar.gz | |
Cleanup internal includes by splitting out some event structs
* Split out BenchmarkInfo and BenchmarkStats to their own header
* Outline BenchmarkStats<> declaration to separate header
* Split out TestRunInfo into its own header
These changes let us remove the large `interfaces_reporter.hpp`
include from `benchmark.hpp`, and replace it with
`interfaces_capture.hpp` in `run_context.hpp`.
I also cleaned out `interfaces_repoter.hpp` from reporter headers
that depend on `reporter_common_base.hpp`. This will not change
anything in the actual inclusion set, but makes it logically
more consistent.
Diffstat (limited to 'src/catch2/internal')
| -rw-r--r-- | src/catch2/internal/catch_run_context.cpp | 3 | ||||
| -rw-r--r-- | src/catch2/internal/catch_run_context.hpp | 5 | ||||
| -rw-r--r-- | src/catch2/internal/catch_test_run_info.hpp | 22 |
3 files changed, 28 insertions, 2 deletions
diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp index 11fcda45..6fd63450 100644 --- a/src/catch2/internal/catch_run_context.cpp +++ b/src/catch2/internal/catch_run_context.cpp @@ -8,8 +8,9 @@ #include <catch2/internal/catch_run_context.hpp> #include <catch2/catch_user_config.hpp> -#include <catch2/interfaces/catch_interfaces_generatortracker.hpp> #include <catch2/interfaces/catch_interfaces_config.hpp> +#include <catch2/interfaces/catch_interfaces_generatortracker.hpp> +#include <catch2/interfaces/catch_interfaces_reporter.hpp> #include <catch2/internal/catch_compiler_capabilities.hpp> #include <catch2/internal/catch_context.hpp> #include <catch2/internal/catch_enforce.hpp> diff --git a/src/catch2/internal/catch_run_context.hpp b/src/catch2/internal/catch_run_context.hpp index de6999e5..fc65f651 100644 --- a/src/catch2/internal/catch_run_context.hpp +++ b/src/catch2/internal/catch_run_context.hpp @@ -8,8 +8,9 @@ #ifndef CATCH_RUN_CONTEXT_HPP_INCLUDED #define CATCH_RUN_CONTEXT_HPP_INCLUDED -#include <catch2/interfaces/catch_interfaces_reporter.hpp> +#include <catch2/interfaces/catch_interfaces_capture.hpp> #include <catch2/internal/catch_test_registry.hpp> +#include <catch2/internal/catch_test_run_info.hpp> #include <catch2/internal/catch_fatal_condition_handler.hpp> #include <catch2/catch_test_case_info.hpp> #include <catch2/catch_message.hpp> @@ -26,6 +27,8 @@ namespace Catch { class IGeneratorTracker; class IConfig; + class IEventListener; + using IEventListenerPtr = Detail::unique_ptr<IEventListener>; /////////////////////////////////////////////////////////////////////////// diff --git a/src/catch2/internal/catch_test_run_info.hpp b/src/catch2/internal/catch_test_run_info.hpp new file mode 100644 index 00000000..90357b0a --- /dev/null +++ b/src/catch2/internal/catch_test_run_info.hpp @@ -0,0 +1,22 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_TEST_RUN_INFO_HPP_INCLUDED +#define CATCH_TEST_RUN_INFO_HPP_INCLUDED + +#include <catch2/internal/catch_stringref.hpp> + +namespace Catch { + + struct TestRunInfo { + constexpr TestRunInfo(StringRef _name) : name(_name) {} + StringRef name; + }; + +} // end namespace Catch + +#endif // CATCH_TEST_RUN_INFO_HPP_INCLUDED |