aboutsummaryrefslogtreecommitdiffstats
path: root/test/testbench.hpp
blob: a5b8853dbcee18d5e36120495b1d6b3108f16db5 (plain)
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
/* ----------------------------------------------------------------------------
 * testbench.hpp
 *
 * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
 * See file LICENSE for more details
 * ----------------------------------------------------------------------------
 */

#ifndef TEST_BENCH_HPP
#define TEST_BENCH_HPP

#include <string>
#include <vector>

struct Test
{
	std::string name;
	bool passed;

	Test(const std::string &_name, bool _passed) : name(_name), passed(_passed) {}
};

class TestBench
{
private:
	int incrementer=0;
	int passed=0;
	int failed=0;

	std::vector<Test> tests_;
	
public:
	TestBench() : tests_() {}

	void startTest(const std::string &test_name);
	void endTest(bool pass);
	void printResults();
};

#endif