YAGE
Yet Another Game Engine
testbench.hpp
1 /* ----------------------------------------------------------------------------
2  * testbench.hpp
3  *
4  * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
5  * See file LICENSE for more details
6  * ----------------------------------------------------------------------------
7  */
8 
9 #ifndef TEST_BENCH_HPP
10 #define TEST_BENCH_HPP
11 
12 #include <string>
13 #include <vector>
14 
15 struct Test
16 {
17  std::string name;
18  bool passed;
19 
20  Test(const std::string &_name, bool _passed) : name(_name), passed(_passed) {}
21 };
22 
23 class TestBench
24 {
25 private:
26  int incrementer=0;
27  int passed=0;
28  int failed=0;
29 
30  std::vector<Test> tests_;
31 
32 public:
33  TestBench() : tests_() {}
34 
35  void startTest(const std::string &test_name);
36  void endTest(bool pass);
37  void printResults();
38 };
39 
40 #endif
Definition: testbench.hpp:23
Definition: testbench.hpp:15