4#include <collections.h>
11 collections_map<std::string, ISpecReporter*> _reporters;
15 _reporters[name] = reporter;
18 bool has(
const char* name)
const override {
19 auto found = _reporters.find(name);
20 return found != _reporters.end();
24 auto found = _reporters.find(name);
25 if (found != _reporters.end())
return found->second;
30 for (
const auto& [name, reporter] : _reporters) fn->invoke(name.c_str(), reporter);
34 for (
const auto& [name, reporter] : _reporters) reporter->report_start();
38 for (
const auto& [name, reporter] : _reporters)
39 reporter->report_test_begin(group, spec);
43 for (
const auto& [name, reporter] : _reporters) reporter->report_setup(result);
47 for (
const auto& [name, reporter] : _reporters) reporter->report_test(result);
51 for (
const auto& [name, reporter] : _reporters) reporter->report_teardown(result);
55 for (
const auto& [name, reporter] : _reporters) reporter->report_test_result(result);
59 for (
const auto& [name, reporter] : _reporters) reporter->report_suite_result(result);
void report_teardown(ISpecRunResult *result) override
bool has(const char *name) const override
void report_start() override
ISpecReporter * get(const char *name) const override
void report_setup(ISpecRunResult *result) override
void report_test_result(ISpecRunResult *result) override
void report_test(ISpecRunResult *result) override
void report_suite_result(ISpecSuiteRunResult *result) override
void add(const char *name, ISpecReporter *reporter) override
void report_test_begin(ISpecGroup *group, ISpec *spec) override
void foreach_reporter(ForEachReporterFn *fn) const override
IFunctionPointer< void(const char *, ISpecReporter *)> ForEachReporterFn