Echo Writes Code

console_reporter.hpp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef CRUCIBLE_TEST_CONSOLE_REPORTER_HPP
#define CRUCIBLE_TEST_CONSOLE_REPORTER_HPP

#include "crucible/test/abstract_reporter.hpp"
#include "crucible/test/fixture.hpp"
#include "crucible/test/outcome.hpp"
#include "crucible/test/scenario.hpp"

#include <cstddef>
#include <map>
#include <string>

namespace crucible::test::console_reporter
{
  class ConsoleReporter final : public abstract_reporter::AbstractReporter
  {
  public:
    ~ConsoleReporter() override;

    auto handle_empty_suite(std::string const &name) -> void override;

    auto handle_suite_start(std::string const &name) -> void override;

    auto handle_suite_end(std::size_t const pass_count, std::size_t const fail_count, std::size_t const scenario_count, std::size_t const fixture_count) -> void override;

    auto handle_group_start(std::string const &group) -> void override;

    auto handle_group_end(std::string const &group) -> void override;

    auto handle_scenario_end(scenario::Scenario const &scenario, outcome::Outcome const &outcome) -> void override;

    auto handle_fixture_end(fixture::Fixture const &fixture, outcome::Outcome const &outcome) -> void override;

    auto set_show_fixtures(bool const show_fixtures) -> void override;

  private:
    bool my_show_fixtures { false };

    std::map<std::string, std::string> my_failures;
  };
}

#endif // CRUCIBLE_TEST_CONSOLE_REPORTER_HPP