From bc524d70253a4ab2fe40c3ca3e5666e267c0a4d1 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Sun, 29 Jun 2025 19:25:29 +0100 Subject: import catch2 3.8.1 --- .../internal/catch_test_case_registry_impl.hpp | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/catch2/internal/catch_test_case_registry_impl.hpp (limited to 'src/catch2/internal/catch_test_case_registry_impl.hpp') diff --git a/src/catch2/internal/catch_test_case_registry_impl.hpp b/src/catch2/internal/catch_test_case_registry_impl.hpp new file mode 100644 index 0000000..fbca89f --- /dev/null +++ b/src/catch2/internal/catch_test_case_registry_impl.hpp @@ -0,0 +1,59 @@ + +// 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_CASE_REGISTRY_IMPL_HPP_INCLUDED +#define CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED + +#include +#include +#include + +#include + +namespace Catch { + + class IConfig; + class ITestInvoker; + class TestCaseHandle; + class TestSpec; + + std::vector sortTests( IConfig const& config, std::vector const& unsortedTestCases ); + + bool isThrowSafe( TestCaseHandle const& testCase, IConfig const& config ); + + std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ); + std::vector const& getAllTestCasesSorted( IConfig const& config ); + + class TestRegistry : public ITestCaseRegistry { + public: + void registerTest( Detail::unique_ptr testInfo, Detail::unique_ptr testInvoker ); + + std::vector const& getAllInfos() const override; + std::vector const& getAllTests() const override; + std::vector const& getAllTestsSorted( IConfig const& config ) const override; + + ~TestRegistry() override; // = default + + private: + std::vector> m_owned_test_infos; + // Keeps a materialized vector for `getAllInfos`. + // We should get rid of that eventually (see interface note) + std::vector m_viewed_test_infos; + + std::vector> m_invokers; + std::vector m_handles; + mutable TestRunOrder m_currentSortOrder = TestRunOrder::Declared; + mutable std::vector m_sortedFunctions; + }; + + /////////////////////////////////////////////////////////////////////////// + + +} // end namespace Catch + + +#endif // CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED -- cgit v1.2.3