10 #define ELPP_NO_CHECK_MACROS
13 #if defined(CATCH_CONFIG_MAIN)
14 #error CATCH_CONFIG_MAIN must not be defined: to run your own main(), use CATCH_CONFIG_RUNNER with #cmake:custom-main
19 #if defined(CATCH_CONFIG_RUNNER)
25 class CustomRunContext :
public RunContext
28 CustomRunContext( CustomRunContext
const& ) =
delete;
29 CustomRunContext & operator=( CustomRunContext
const& ) =
delete;
32 explicit CustomRunContext( IStreamingReporterPtr&& reporter,
IConfigPtr const&
cfg )
38 explicit CustomRunContext( std::string
const & reporter_type =
"compact",
IConfigPtr const &
cfg =
IConfigPtr(
new Config ) )
44 explicit CustomRunContext( Catch::ConfigData
const &
cfg, std::string
const & reporter_type =
"compact" )
45 : CustomRunContext( reporter_type,
IConfigPtr(
new Config(
cfg ) ) )
51 void set_redirection(
bool on )
53 auto r =
dynamic_cast<Catch::CompactReporter *
>(&reporter());
55 r->m_reporterPrefs.shouldRedirectStdOut = on;
59 Totals run_test( std::string
const &
name,
T test )
65 void invoke()
const override
71 TestCaseInfo(
name, {}, {}, {}, {
"",0} )
73 return runTest( test_case );
79 #endif // CATCH_CONFIG_RUNNER