From 3d49d83128f80b70edd5333729f5d8bc96a5b018 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 21 Sep 2017 09:32:46 +0100 Subject: [PATCH] Added benchmark support to MultiReporters - otherwise benchmarks are not reported if multiple reporters (usually reporter + listener(s)) are used --- include/reporters/catch_reporter_multi.cpp | 8 ++++++++ include/reporters/catch_reporter_multi.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/include/reporters/catch_reporter_multi.cpp b/include/reporters/catch_reporter_multi.cpp index 017b628d..23bb1603 100644 --- a/include/reporters/catch_reporter_multi.cpp +++ b/include/reporters/catch_reporter_multi.cpp @@ -28,6 +28,14 @@ namespace Catch { reporter->noMatchingTestCases( spec ); } + void MultipleReporters::benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) { + for( auto const& reporter : m_reporters ) + reporter->benchmarkStarting( benchmarkInfo ); + } + void MultipleReporters::benchmarkEnded( BenchmarkStats const& benchmarkStats ) { + for( auto const& reporter : m_reporters ) + reporter->benchmarkEnded( benchmarkStats ); + } void MultipleReporters::testRunStarting( TestRunInfo const& testRunInfo ) { for( auto const& reporter : m_reporters ) diff --git a/include/reporters/catch_reporter_multi.h b/include/reporters/catch_reporter_multi.h index 02924c9c..985d442f 100644 --- a/include/reporters/catch_reporter_multi.h +++ b/include/reporters/catch_reporter_multi.h @@ -26,6 +26,9 @@ namespace Catch { static std::set getSupportedVerbosities(); + void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) override; + void benchmarkEnded( BenchmarkStats const& benchmarkStats ) override; + void testRunStarting( TestRunInfo const& testRunInfo ) override; void testGroupStarting( GroupInfo const& groupInfo ) override; void testCaseStarting( TestCaseInfo const& testInfo ) override;