aboutsummaryrefslogtreecommitdiff
path: root/src/test/main.cpp
blob: 19a8d6ee2b38cbe5d1e43a6ce29f4b43aa6df0a7 (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
#include <crepe/api/Config.h>

#include <gtest/gtest.h>

using namespace crepe;
using namespace testing;

class GlobalConfigReset : public EmptyTestEventListener {
public:
	Config & cfg = Config::get_instance();

	// This function is called before each test
	void OnTestStart(const TestInfo &) override {
		cfg.log.level = Log::Level::WARNING;
	}
};

int main(int argc, char ** argv) {
	InitGoogleTest(&argc, argv);

	UnitTest & ut = *UnitTest::GetInstance();
	ut.listeners().Append(new GlobalConfigReset);

	return RUN_ALL_TESTS();
}