1#ifndef BANDIT_LISTENER_H
2#define BANDIT_LISTENER_H
3
4#include <memory>
5#include <bandit/assertion_exception.h>
6#include <bandit/test_run_error.h>
7
8namespace bandit {
9 namespace detail {
10 struct listener {
11 virtual ~listener() {}
12
13 virtual void test_run_starting() = 0;
14 virtual void test_run_complete() = 0;
15
16 virtual void context_starting(const std::string& desc) = 0;
17 virtual void context_ended(const std::string& desc) = 0;
18 virtual void test_run_error(const std::string& desc, const test_run_error& error) = 0;
19
20 virtual void it_starting(const std::string& desc) = 0;
21 virtual void it_succeeded(const std::string& desc) = 0;
22 virtual void it_failed(const std::string& desc, const detail::assertion_exception& ex) = 0;
23 virtual void it_unknown_error(const std::string& desc) = 0;
24 virtual void it_skip(const std::string& desc) = 0;
25
26 virtual bool did_we_pass() const = 0;
27 };
28
29 typedef std::unique_ptr<listener> listener_ptr;
30 }
31}
32#endif
33