]> git.localhorst.tv Git - l2e.git/blob - tests/all.cpp
added first unit test
[l2e.git] / tests / all.cpp
1 #include "../src/sdl/InitImage.h"
2 #include "../src/sdl/InitSDL.h"
3
4 #include <iostream>
5 #include <SDL.h>
6 #include <SDL_image.h>
7 #include <cppunit/extensions/TestFactoryRegistry.h>
8 #include <cppunit/ui/text/TestRunner.h>
9
10 using CppUnit::TestFactoryRegistry;
11 using CppUnit::TextUi::TestRunner;
12
13
14 int main(int argc, char **argv) {
15
16         try {
17                 sdl::InitSDL sdl;
18                 sdl::InitImage image(IMG_INIT_PNG);
19
20                 TestRunner runner;
21                 TestFactoryRegistry &registry = TestFactoryRegistry::getRegistry();
22                 runner.addTest(registry.makeTest());
23                 runner.run();
24         } catch (std::exception &e) {
25                 std::cerr << "exception in main(): " << e.what() << std::endl;
26                 return 1;
27         }
28
29         return 0;
30
31 }