diff options
| author | Martin Hořeňovský | 2023-01-17 11:04:49 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2023-01-22 16:04:16 +0100 |
| commit | 8359a6b244a26cffabd4440b17fac8b1392815af (patch) | |
| tree | eb0a396ddc582cb7f1b5e5f7d0b3b369d18ebc40 /src/catch2/interfaces | |
| parent | adf43494e19077d492343ea13d597af5133b7288 (diff) | |
| download | catch3-8359a6b244a26cffabd4440b17fac8b1392815af.tar.gz | |
Stop exceptions in generator constructors from aborting the binary
Fixes #2615
Diffstat (limited to 'src/catch2/interfaces')
| -rw-r--r-- | src/catch2/interfaces/catch_interfaces_capture.hpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/catch2/interfaces/catch_interfaces_capture.hpp b/src/catch2/interfaces/catch_interfaces_capture.hpp index ac25a8c0..0fe27e53 100644 --- a/src/catch2/interfaces/catch_interfaces_capture.hpp +++ b/src/catch2/interfaces/catch_interfaces_capture.hpp @@ -13,6 +13,7 @@ #include <catch2/internal/catch_stringref.hpp> #include <catch2/internal/catch_result_type.hpp> +#include <catch2/internal/catch_unique_ptr.hpp> namespace Catch { @@ -33,6 +34,12 @@ namespace Catch { template <typename Duration = std::chrono::duration<double, std::nano>> struct BenchmarkStats; + namespace Generators { + class GeneratorUntypedBase; + using GeneratorBasePtr = Catch::Detail::unique_ptr<GeneratorUntypedBase>; + } + + class IResultCapture { public: virtual ~IResultCapture(); @@ -42,7 +49,13 @@ namespace Catch { virtual void sectionEnded( SectionEndInfo const& endInfo ) = 0; virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) = 0; - virtual auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& = 0; + virtual IGeneratorTracker* + acquireGeneratorTracker( StringRef generatorName, + SourceLineInfo const& lineInfo ) = 0; + virtual IGeneratorTracker* + createGeneratorTracker( StringRef generatorName, + SourceLineInfo lineInfo, + Generators::GeneratorBasePtr&& generator ) = 0; virtual void benchmarkPreparing( StringRef name ) = 0; virtual void benchmarkStarting( BenchmarkInfo const& info ) = 0; |