aboutsummaryrefslogtreecommitdiffstats
path: root/tests/testshared.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testshared.h')
-rw-r--r--tests/testshared.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/testshared.h b/tests/testshared.h
new file mode 100644
index 00000000..4418072c
--- /dev/null
+++ b/tests/testshared.h
@@ -0,0 +1,33 @@
+/** ---------------------------------------------------------------------------
+ * @file: testshared.h
+ *
+ * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
+ * MIT License, see LICENSE file for more details.
+ * ----------------------------------------------------------------------------
+ */
+
+#ifndef TEST_TESTSHARED_H
+#define TEST_TESTSHARED_H
+
+#define OPENGL_TEST_MAIN(LOGLEVEL) \
+ int main(int argc, char **argv) \
+ { \
+ yLogger.setLevel(LOGLEVEL); \
+ ::testing::InitGoogleTest(&argc, argv); \
+ ::yage::init(); \
+ ::yage::Window x; \
+ x.create("Window", 800, 600); \
+ auto ret = RUN_ALL_TESTS(); \
+ ::yage::quit(); \
+ return ret; \
+ }
+
+#define TEST_MAIN(LOGLEVEL) \
+ int main(int argc, char **argv) \
+ { \
+ yLogger.setLevel(LOGLEVEL); \
+ testing::InitGoogleTest(&argc, argv); \
+ return RUN_ALL_TESTS(); \
+ }
+
+#endif