summaryrefslogtreecommitdiff
path: root/src/maingui.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-18 22:51:52 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-18 22:53:01 +0300
commit40de3bee0278d6584561a827123bc342934adccb (patch)
tree460ba68f29ec25377ef1971989c4c46e507ea3da /src/maingui.cpp
parentdffd0a4a8e99196ad27f8fde2430b09dd29cac57 (diff)
downloadmanaplus-40de3bee0278d6584561a827123bc342934adccb.tar.gz
manaplus-40de3bee0278d6584561a827123bc342934adccb.tar.bz2
manaplus-40de3bee0278d6584561a827123bc342934adccb.tar.xz
manaplus-40de3bee0278d6584561a827123bc342934adccb.zip
Add support for additional unit test library doctest.
Diffstat (limited to 'src/maingui.cpp')
-rw-r--r--src/maingui.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/maingui.cpp b/src/maingui.cpp
index 37536470a..374158183 100644
--- a/src/maingui.cpp
+++ b/src/maingui.cpp
@@ -49,8 +49,14 @@
#endif // SDL_VERSIONNUM
#ifdef UNITTESTS
+#ifdef UNITTESTS_CATCH
#define CATCH_CONFIG_RUNNER
#include "test/catch.hpp"
+#endif // UNITTESTS_CATCH
+#ifdef UNITTESTS_DOCTEST
+#define DOCTEST_CONFIG_IMPLEMENT
+#include "test/doctest.h"
+#endif // UNITTESTS_DOCTEST
#else // UNITTESTS
#include "utils/xml.h"
#endif // UNITTESTS
@@ -140,7 +146,15 @@ int mainGui(int argc, char *argv[])
int main(int argc, char *argv[])
{
VirtFs::init(argv[0]);
+#ifdef UNITTESTS_CATCH
return Catch::Session().run(argc, argv);
+#elif defined(UNITTESTS_DOCTEST)
+ doctest::Context context;
+ context.applyCommandLine(argc, argv);
+ return context.run();
+#else // UNITTESTS_CATCH
+ return 1;
+#endif // UNITTESTS_CATCH
}
#endif // UNITTESTS