Echo Writes Code

cli.cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "crucible/test/cli.hpp"

#include "crucible/test/reporter.hpp"
#include "crucible/test/suite.hpp"

#include <cstdlib>

namespace crucible::test::cli {
  auto execute(int argc, char *argv[]) -> int {
    auto &suite = suite::Suite::get_reference();

    auto reporter = reporter::make_console_reporter();
    bool const all_passed = suite.execute(reporter);

    if (all_passed) {
      return EXIT_SUCCESS;
    } else {
      return EXIT_FAILURE;
    }
  }
}