aboutsummaryrefslogtreecommitdiff
path: root/src/test/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/main.cpp')
-rw-r--r--src/test/main.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/main.cpp b/src/test/main.cpp
new file mode 100644
index 0000000..0e1bc75
--- /dev/null
+++ b/src/test/main.cpp
@@ -0,0 +1,29 @@
+#include <gtest/gtest.h>
+
+#include <crepe/api/Config.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();
+}