diff options
| author | Martin Hořeňovský | 2022-06-21 16:19:50 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2022-06-21 18:48:44 +0200 |
| commit | 8730260457ddbd19f3df70c53931934398fc54d7 (patch) | |
| tree | 8ffede0fbd3b564aa2e16daad1d7c60a95fa5020 | |
| parent | bdfa920f931f186edf3c3042d49ddd341c4dbfc9 (diff) | |
| download | catch3-8730260457ddbd19f3df70c53931934398fc54d7.tar.gz | |
Split apart combined TUs
The compile time improvements from using combined TUs mostly isn't
worth the annoyance they cause with various IDE shortcuts, like
when switching between header and its impl. file.
Splitting them apart also fixes the issue of empty subdirs being
installed due to `foo/internal` folders that only contained the
combined TUs and no headers.
Closes #2457
Closes #2463
33 files changed, 615 insertions, 618 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 341da85c..d00d368b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,7 +31,9 @@ set(BENCHMARK_HEADERS ${SOURCES_DIR}/benchmark/detail/catch_timing.hpp ) set(BENCHMARK_SOURCES - ${SOURCES_DIR}/benchmark/internal/catch_benchmark_combined_tu.cpp + ${SOURCES_DIR}/benchmark/catch_chronometer.cpp + ${SOURCES_DIR}/benchmark/detail/catch_benchmark_function.cpp + ${SOURCES_DIR}/benchmark/detail/catch_run_for_at_least.cpp ${SOURCES_DIR}/benchmark/detail/catch_stats.cpp ) @@ -166,7 +168,6 @@ set(IMPL_SOURCES ${SOURCES_DIR}/catch_approx.cpp ${SOURCES_DIR}/internal/catch_assertion_handler.cpp ${SOURCES_DIR}/catch_assertion_result.cpp - ${SOURCES_DIR}/matchers/internal/catch_matchers_combined_tu.cpp ${SOURCES_DIR}/internal/catch_clara.cpp ${SOURCES_DIR}/internal/catch_commandline.cpp ${SOURCES_DIR}/internal/catch_source_line_info.cpp @@ -182,8 +183,6 @@ set(IMPL_SOURCES ${SOURCES_DIR}/internal/catch_fatal_condition_handler.cpp ${SOURCES_DIR}/internal/catch_floating_point_helpers.cpp ${SOURCES_DIR}/internal/catch_istream.cpp - ${SOURCES_DIR}/generators/internal/catch_generators_combined_tu.cpp - ${SOURCES_DIR}/interfaces/catch_interfaces_combined_tu.cpp ${SOURCES_DIR}/interfaces/catch_interfaces_generatortracker.cpp ${SOURCES_DIR}/interfaces/catch_interfaces_reporter.cpp ${SOURCES_DIR}/internal/catch_list.cpp @@ -193,7 +192,6 @@ set(IMPL_SOURCES ${SOURCES_DIR}/catch_message.cpp ${SOURCES_DIR}/internal/catch_output_redirect.cpp ${SOURCES_DIR}/catch_registry_hub.cpp - ${SOURCES_DIR}/internal/catch_combined_tu.cpp ${SOURCES_DIR}/internal/catch_random_number_generator.cpp ${SOURCES_DIR}/internal/catch_random_seed_generation.cpp ${SOURCES_DIR}/internal/catch_reporter_registry.cpp @@ -223,6 +221,29 @@ set(IMPL_SOURCES ${SOURCES_DIR}/internal/catch_xmlwriter.cpp ${SOURCES_DIR}/internal/catch_test_case_info_hasher.cpp ${SOURCES_DIR}/generators/catch_generators_random.cpp + ${SOURCES_DIR}/generators/catch_generator_exception.cpp + ${SOURCES_DIR}/generators/catch_generators.cpp + ${SOURCES_DIR}/matchers/catch_matchers.cpp + ${SOURCES_DIR}/matchers/catch_matchers_container_properties.cpp + ${SOURCES_DIR}/matchers/catch_matchers_exception.cpp + ${SOURCES_DIR}/matchers/catch_matchers_predicate.cpp + ${SOURCES_DIR}/matchers/internal/catch_matchers_impl.cpp + ${SOURCES_DIR}/catch_tag_alias_autoregistrar.cpp + ${SOURCES_DIR}/internal/catch_decomposer.cpp + ${SOURCES_DIR}/internal/catch_errno_guard.cpp + ${SOURCES_DIR}/internal/catch_lazy_expr.cpp + ${SOURCES_DIR}/internal/catch_leak_detector.cpp + ${SOURCES_DIR}/internal/catch_message_info.cpp + ${SOURCES_DIR}/internal/catch_polyfills.cpp + ${SOURCES_DIR}/internal/catch_startup_exception_registry.cpp + ${SOURCES_DIR}/internal/catch_uncaught_exceptions.cpp + ${SOURCES_DIR}/interfaces/catch_interfaces_capture.cpp + ${SOURCES_DIR}/interfaces/catch_interfaces_config.cpp + ${SOURCES_DIR}/interfaces/catch_interfaces_exception.cpp + ${SOURCES_DIR}/interfaces/catch_interfaces_registry_hub.cpp + ${SOURCES_DIR}/interfaces/catch_interfaces_reporter_factory.cpp + ${SOURCES_DIR}/interfaces/catch_interfaces_reporter_registry.cpp + ${SOURCES_DIR}/interfaces/catch_interfaces_testcase.cpp ) set(INTERNAL_FILES ${IMPL_SOURCES} ${INTERNAL_HEADERS}) @@ -247,11 +268,12 @@ set(REPORTER_HEADERS ) set(REPORTER_SOURCES ${SOURCES_DIR}/reporters/catch_reporter_automake.cpp - ${SOURCES_DIR}/reporters/catch_reporter_combined_tu.cpp ${SOURCES_DIR}/reporters/catch_reporter_common_base.cpp ${SOURCES_DIR}/reporters/catch_reporter_compact.cpp ${SOURCES_DIR}/reporters/catch_reporter_console.cpp ${SOURCES_DIR}/reporters/catch_reporter_cumulative_base.cpp + ${SOURCES_DIR}/reporters/catch_reporter_event_listener.cpp + ${SOURCES_DIR}/reporters/catch_reporter_helpers.cpp ${SOURCES_DIR}/reporters/catch_reporter_junit.cpp ${SOURCES_DIR}/reporters/catch_reporter_multi.cpp ${SOURCES_DIR}/reporters/catch_reporter_registrars.cpp diff --git a/src/catch2/benchmark/catch_chronometer.cpp b/src/catch2/benchmark/catch_chronometer.cpp new file mode 100644 index 00000000..459a26c7 --- /dev/null +++ b/src/catch2/benchmark/catch_chronometer.cpp @@ -0,0 +1,17 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/benchmark/catch_chronometer.hpp> + +namespace Catch { + namespace Benchmark { + namespace Detail { + ChronometerConcept::~ChronometerConcept() = default; + } // namespace Detail + } // namespace Benchmark +} // namespace Catch diff --git a/src/catch2/benchmark/detail/catch_benchmark_function.cpp b/src/catch2/benchmark/detail/catch_benchmark_function.cpp new file mode 100644 index 00000000..9562d29e --- /dev/null +++ b/src/catch2/benchmark/detail/catch_benchmark_function.cpp @@ -0,0 +1,17 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/benchmark/detail/catch_benchmark_function.hpp> + +namespace Catch { + namespace Benchmark { + namespace Detail { + BenchmarkFunction::callable::~callable() = default; + } // namespace Detail + } // namespace Benchmark +} // namespace Catch diff --git a/src/catch2/benchmark/detail/catch_run_for_at_least.cpp b/src/catch2/benchmark/detail/catch_run_for_at_least.cpp new file mode 100644 index 00000000..6c246d6a --- /dev/null +++ b/src/catch2/benchmark/detail/catch_run_for_at_least.cpp @@ -0,0 +1,30 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/benchmark/detail/catch_run_for_at_least.hpp> +#include <exception> +#include <catch2/internal/catch_enforce.hpp> + +namespace Catch { + namespace Benchmark { + namespace Detail { + struct optimized_away_error : std::exception { + const char* what() const noexcept override; + }; + + const char* optimized_away_error::what() const noexcept { + return "could not measure benchmark, maybe it was optimized away"; + } + + void throw_optimized_away_error() { + Catch::throw_exception(optimized_away_error{}); + } + + } // namespace Detail + } // namespace Benchmark +} // namespace Catch diff --git a/src/catch2/benchmark/internal/catch_benchmark_combined_tu.cpp b/src/catch2/benchmark/internal/catch_benchmark_combined_tu.cpp deleted file mode 100644 index ffbae696..00000000 --- a/src/catch2/benchmark/internal/catch_benchmark_combined_tu.cpp +++ /dev/null @@ -1,75 +0,0 @@ - -// Copyright Catch2 Authors -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// https://www.boost.org/LICENSE_1_0.txt) - -// SPDX-License-Identifier: BSL-1.0 -/** \file - * This is a special TU that combines what would otherwise be a very - * small benchmarking-related TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ - -//////////////////////////////////////////// -// vvv formerly catch_chronometer.cpp vvv // -//////////////////////////////////////////// - -#include <catch2/benchmark/catch_chronometer.hpp> - -namespace Catch { - namespace Benchmark { - namespace Detail { - ChronometerConcept::~ChronometerConcept() = default; - } // namespace Detail - } // namespace Benchmark -} // namespace Catch - - -/////////////////////////////////////////////////// -// vvv formerly catch_benchmark_function.cpp vvv // -/////////////////////////////////////////////////// - -#include <catch2/benchmark/detail/catch_benchmark_function.hpp> - -namespace Catch { - namespace Benchmark { - namespace Detail { - BenchmarkFunction::callable::~callable() = default; - } // namespace Detail - } // namespace Benchmark -} // namespace Catch - - -///////////////////////////////////////////////// -// vvv formerly catch_run_for_at_least.cpp vvv // -///////////////////////////////////////////////// - -#include <catch2/benchmark/detail/catch_run_for_at_least.hpp> -#include <exception> -#include <catch2/internal/catch_enforce.hpp> - -namespace Catch { - namespace Benchmark { - namespace Detail { - struct optimized_away_error : std::exception { - const char* what() const noexcept override; - }; - - const char* optimized_away_error::what() const noexcept { - return "could not measure benchmark, maybe it was optimized away"; - } - - void throw_optimized_away_error() { - Catch::throw_exception(optimized_away_error{}); - } - - } // namespace Detail - } // namespace Benchmark -} // namespace Catch diff --git a/src/catch2/catch_tag_alias_autoregistrar.cpp b/src/catch2/catch_tag_alias_autoregistrar.cpp new file mode 100644 index 00000000..d3e10cb0 --- /dev/null +++ b/src/catch2/catch_tag_alias_autoregistrar.cpp @@ -0,0 +1,24 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/catch_tag_alias_autoregistrar.hpp> +#include <catch2/internal/catch_compiler_capabilities.hpp> +#include <catch2/interfaces/catch_interfaces_registry_hub.hpp> + +namespace Catch { + + RegistrarForTagAliases::RegistrarForTagAliases(char const* alias, char const* tag, SourceLineInfo const& lineInfo) { + CATCH_TRY { + getMutableRegistryHub().registerTagAlias(alias, tag, lineInfo); + } CATCH_CATCH_ALL { + // Do not throw when constructing global objects, instead register the exception to be processed later + getMutableRegistryHub().registerStartupException(); + } + } + +} diff --git a/src/catch2/generators/catch_generator_exception.cpp b/src/catch2/generators/catch_generator_exception.cpp new file mode 100644 index 00000000..70a991e3 --- /dev/null +++ b/src/catch2/generators/catch_generator_exception.cpp @@ -0,0 +1,17 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/generators/catch_generator_exception.hpp> + +namespace Catch { + + const char* GeneratorException::what() const noexcept { + return m_msg; + } + +} // end namespace Catch diff --git a/src/catch2/generators/internal/catch_generators_combined_tu.cpp b/src/catch2/generators/catch_generators.cpp index da1b62e9..3e09bfd9 100644 --- a/src/catch2/generators/internal/catch_generators_combined_tu.cpp +++ b/src/catch2/generators/catch_generators.cpp @@ -5,36 +5,6 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -/** \file - * This is a special TU that combines what would otherwise be a very - * small generator-related TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ - -//////////////////////////////////////////////////// -// vvv formerly catch_generator_exception.cpp vvv // -//////////////////////////////////////////////////// - -#include <catch2/generators/catch_generator_exception.hpp> - -namespace Catch { - - const char* GeneratorException::what() const noexcept { - return m_msg; - } - -} // end namespace Catch - - -/////////////////////////////////////////// -// vvv formerly catch_generators.cpp vvv // -/////////////////////////////////////////// #include <catch2/generators/catch_generators.hpp> #include <catch2/internal/catch_enforce.hpp> diff --git a/src/catch2/interfaces/catch_interfaces_capture.cpp b/src/catch2/interfaces/catch_interfaces_capture.cpp new file mode 100644 index 00000000..fb98a75d --- /dev/null +++ b/src/catch2/interfaces/catch_interfaces_capture.cpp @@ -0,0 +1,13 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/interfaces/catch_interfaces_capture.hpp> + +namespace Catch { + IResultCapture::~IResultCapture() = default; +} diff --git a/src/catch2/interfaces/catch_interfaces_combined_tu.cpp b/src/catch2/interfaces/catch_interfaces_combined_tu.cpp deleted file mode 100644 index 2e126a46..00000000 --- a/src/catch2/interfaces/catch_interfaces_combined_tu.cpp +++ /dev/null @@ -1,90 +0,0 @@ - -// Copyright Catch2 Authors -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// https://www.boost.org/LICENSE_1_0.txt) - -// SPDX-License-Identifier: BSL-1.0 -/** \file - * This is a special TU that combines what would otherwise be a very - * small interfaces-related TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ - -/////////////////////////////////////////////////// -// vvv formerly catch_interfaces_capture.cpp vvv // -/////////////////////////////////////////////////// - -#include <catch2/interfaces/catch_interfaces_capture.hpp> - -namespace Catch { - IResultCapture::~IResultCapture() = default; -} - - -////////////////////////////////////////////////// -// vvv formerly catch_interfaces_config.cpp vvv // -////////////////////////////////////////////////// - -#include <catch2/interfaces/catch_interfaces_config.hpp> - -namespace Catch { - IConfig::~IConfig() = default; -} - - -///////////////////////////////////////////////////// -// vvv formerly catch_interfaces_exception.cpp vvv // -///////////////////////////////////////////////////// - -#include <catch2/interfaces/catch_interfaces_exception.hpp> - -namespace Catch { - IExceptionTranslator::~IExceptionTranslator() = default; - IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() = default; -} - - -//////////////////////////////////////////////////////// -// vvv formerly catch_interfaces_registry_hub.cpp vvv // -//////////////////////////////////////////////////////// - -#include <catch2/interfaces/catch_interfaces_registry_hub.hpp> - -namespace Catch { - IRegistryHub::~IRegistryHub() = default; - IMutableRegistryHub::~IMutableRegistryHub() = default; -} - - -//////////////////////////////////////////////////// -// vvv formerly catch_interfaces_testcase.cpp vvv // -//////////////////////////////////////////////////// - -#include <catch2/interfaces/catch_interfaces_testcase.hpp> - -namespace Catch { - ITestInvoker::~ITestInvoker() = default; - ITestCaseRegistry::~ITestCaseRegistry() = default; -} - - -#include <catch2/interfaces/catch_interfaces_reporter_registry.hpp> - -namespace Catch { - IReporterRegistry::~IReporterRegistry() = default; -} - - -#include <catch2/interfaces/catch_interfaces_reporter_factory.hpp> - -namespace Catch { - IReporterFactory::~IReporterFactory() = default; - EventListenerFactory::~EventListenerFactory() = default; -} diff --git a/src/catch2/interfaces/catch_interfaces_config.cpp b/src/catch2/interfaces/catch_interfaces_config.cpp new file mode 100644 index 00000000..13d761df --- /dev/null +++ b/src/catch2/interfaces/catch_interfaces_config.cpp @@ -0,0 +1,13 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/interfaces/catch_interfaces_config.hpp> + +namespace Catch { + IConfig::~IConfig() = default; +} diff --git a/src/catch2/interfaces/catch_interfaces_exception.cpp b/src/catch2/interfaces/catch_interfaces_exception.cpp new file mode 100644 index 00000000..f0de7450 --- /dev/null +++ b/src/catch2/interfaces/catch_interfaces_exception.cpp @@ -0,0 +1,14 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/interfaces/catch_interfaces_exception.hpp> + +namespace Catch { + IExceptionTranslator::~IExceptionTranslator() = default; + IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() = default; +} diff --git a/src/catch2/interfaces/catch_interfaces_registry_hub.cpp b/src/catch2/interfaces/catch_interfaces_registry_hub.cpp new file mode 100644 index 00000000..557f7303 --- /dev/null +++ b/src/catch2/interfaces/catch_interfaces_registry_hub.cpp @@ -0,0 +1,14 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/interfaces/catch_interfaces_registry_hub.hpp> + +namespace Catch { + IRegistryHub::~IRegistryHub() = default; + IMutableRegistryHub::~IMutableRegistryHub() = default; +} diff --git a/src/catch2/interfaces/catch_interfaces_reporter_factory.cpp b/src/catch2/interfaces/catch_interfaces_reporter_factory.cpp new file mode 100644 index 00000000..8732ed89 --- /dev/null +++ b/src/catch2/interfaces/catch_interfaces_reporter_factory.cpp @@ -0,0 +1,14 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/interfaces/catch_interfaces_reporter_factory.hpp> + +namespace Catch { + IReporterFactory::~IReporterFactory() = default; + EventListenerFactory::~EventListenerFactory() = default; +} diff --git a/src/catch2/interfaces/catch_interfaces_reporter_registry.cpp b/src/catch2/interfaces/catch_interfaces_reporter_registry.cpp new file mode 100644 index 00000000..bd38ac28 --- /dev/null +++ b/src/catch2/interfaces/catch_interfaces_reporter_registry.cpp @@ -0,0 +1,13 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/interfaces/catch_interfaces_reporter_registry.hpp> + +namespace Catch { + IReporterRegistry::~IReporterRegistry() = default; +} diff --git a/src/catch2/interfaces/catch_interfaces_testcase.cpp b/src/catch2/interfaces/catch_interfaces_testcase.cpp new file mode 100644 index 00000000..ec32d667 --- /dev/null +++ b/src/catch2/interfaces/catch_interfaces_testcase.cpp @@ -0,0 +1,14 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/interfaces/catch_interfaces_testcase.hpp> + +namespace Catch { + ITestInvoker::~ITestInvoker() = default; + ITestCaseRegistry::~ITestCaseRegistry() = default; +} diff --git a/src/catch2/internal/catch_combined_tu.cpp b/src/catch2/internal/catch_combined_tu.cpp deleted file mode 100644 index 601ac8e7..00000000 --- a/src/catch2/internal/catch_combined_tu.cpp +++ /dev/null @@ -1,237 +0,0 @@ - -// Copyright Catch2 Authors -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// https://www.boost.org/LICENSE_1_0.txt) - -// SPDX-License-Identifier: BSL-1.0 -/** \file - * This is a special TU that combines what would otherwise be a very - * small top-level TUs into one bigger TU. - * - * The reason for this is compilation performance improvements by - * avoiding reparsing headers for many small TUs, instead having this - * one TU include bit more, but having it all parsed only once. - * - * To avoid heavy-tail problem with compilation times, each "subpart" - * of Catch2 has its own combined TU like this. - */ - - -//////////////////////////////////////////////////////// -// vvv formerly catch_tag_alias_autoregistrar.cpp vvv // -//////////////////////////////////////////////////////// - -#include <catch2/catch_tag_alias_autoregistrar.hpp> -#include <catch2/internal/catch_compiler_capabilities.hpp> -#include <catch2/interfaces/catch_interfaces_registry_hub.hpp> - -namespace Catch { - - RegistrarForTagAliases::RegistrarForTagAliases(char const* alias, char const* tag, SourceLineInfo const& lineInfo) { - CATCH_TRY { - getMutableRegistryHub().registerTagAlias(alias, tag, lineInfo); - } CATCH_CATCH_ALL { - // Do not throw when constructing global objects, instead register the exception to be processed later - getMutableRegistryHub().registerStartupException(); - } - } - -} - - -////////////////////////////////////////// -// vvv formerly catch_polyfills.cpp vvv // -////////////////////////////////////////// - -#include <catch2/internal/catch_polyfills.hpp> -#include <catch2/internal/catch_compiler_capabilities.hpp> -#include <cmath> - -namespace Catch { - -#if !defined(CATCH_CONFIG_POLYFILL_ISNAN) - bool isnan(float f) { - return std::isnan(f); - } - bool isnan(double d) { - return std::isnan(d); - } -#else - // For now we only use this for embarcadero - bool isnan(float f) { - return std::_isnan(f); - } - bool isnan(double d) { - return std::_isnan(d); - } -#endif - -} // end namespace Catch - - -//////////////////////////////////////////////////// |