diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-18 22:51:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-18 22:53:01 +0300 |
commit | 40de3bee0278d6584561a827123bc342934adccb (patch) | |
tree | 460ba68f29ec25377ef1971989c4c46e507ea3da /src/maingui.cpp | |
parent | dffd0a4a8e99196ad27f8fde2430b09dd29cac57 (diff) | |
download | manaverse-40de3bee0278d6584561a827123bc342934adccb.tar.gz manaverse-40de3bee0278d6584561a827123bc342934adccb.tar.bz2 manaverse-40de3bee0278d6584561a827123bc342934adccb.tar.xz manaverse-40de3bee0278d6584561a827123bc342934adccb.zip |
Add support for additional unit test library doctest.
Diffstat (limited to 'src/maingui.cpp')
-rw-r--r-- | src/maingui.cpp | 14 |
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 |