diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-01-05 17:00:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-01-05 17:00:02 +0300 |
commit | 855387d2d795c9471587cc7ddf2c66bb676d698e (patch) | |
tree | 3dbb1260c219312f36893dfae52f5cd40760aeb5 /src/maingui.cpp | |
parent | 9fefb2942865846ccb7dbdac4ebd4515b8c851a2 (diff) | |
download | manaplus-855387d2d795c9471587cc7ddf2c66bb676d698e.tar.gz manaplus-855387d2d795c9471587cc7ddf2c66bb676d698e.tar.bz2 manaplus-855387d2d795c9471587cc7ddf2c66bb676d698e.tar.xz manaplus-855387d2d795c9471587cc7ddf2c66bb676d698e.zip |
Fix different issues in unit tests.
Fix crash with some compilers flags.
Clean window container to null after it was removed.
Init and deinit physfs globally.
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 e3e7012fd..7f4e1950f 100644 --- a/src/maingui.cpp +++ b/src/maingui.cpp @@ -49,6 +49,12 @@ #error missing <SDL_version.h> #endif // SDL_VERSIONNUM +#ifdef UNITTESTS +//#define CATCH_CONFIG_MAIN +#define CATCH_CONFIG_RUNNER +#include "catch.hpp" +#endif // UNITTESTS + #define SDL_IMAGE_COMPILEDVERSION \ SDL_VERSIONNUM(SDL_IMAGE_MAJOR_VERSION, \ SDL_IMAGE_MINOR_VERSION, SDL_IMAGE_PATCHLEVEL) @@ -135,4 +141,12 @@ int mainGui(int argc, char *argv[]) return ret; } +#else // UNITTESTS + +int main(int argc, char *argv[]) +{ + PhysFs::init(argv[0]); + return Catch::Session().run(argc, argv); +} + #endif // UNITTESTS |