Customize the test reporter
masterTo change how test results are displayed (e.g., changing the output format), specialize ut::cfg<ut::override> with a custom reporter. The reporter responds to events like test_begin, test_end, assertion_pass, assertion_fail, and summary.
namespace ut = boost::ut;
namespace cfg {
class reporter {
public:
auto on(ut::events::test_begin) -> void {}
auto on(ut::events::test_run) -> void {}
auto on(ut::events::test_skip) -> void {}
auto on(ut::events::test_end) -> void {}
template <class TMsg> auto on(ut::events::log<TMsg>) -> void {}
template <class TExpr> auto on(ut::events::assertion_pass<TExpr>) -> void {}
template <class TExpr> auto on(ut::events::assertion_fail<TExpr>) -> void {}
auto on(ut::events::fatal_assertion) -> void {}
auto on(ut::events::exception) -> void {}
auto on(ut::events::summary) -> void {}
};
}
template <> auto ut::cfg<ut::override> = ut::runner<cfg::reporter>{};