From 25605d8c06ddc83dfc98053e80e81db7210d5b6f Mon Sep 17 00:00:00 2001 From: David Capello Date: Sun, 12 Aug 2012 14:49:02 -0300 Subject: [PATCH] Fix UI unit tests: they must use/be linked to "she" library. --- src/CMakeLists.txt | 2 +- src/tests/test.h | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e806f0056..c3c714cbb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -459,7 +459,7 @@ endfunction() find_unittests(base base-lib ${sys_libs}) find_unittests(gfx gfx-lib base-lib ${sys_libs}) -find_unittests(ui ui-lib gfx-lib base-lib ${libs3rdparty} ${sys_libs}) +find_unittests(ui ui-lib she gfx-lib base-lib ${libs3rdparty} ${sys_libs}) find_unittests(file ${all_libs}) find_unittests(app ${all_libs}) find_unittests(. ${all_libs}) diff --git a/src/tests/test.h b/src/tests/test.h index b5b7f1516..f63bc0459 100644 --- a/src/tests/test.h +++ b/src/tests/test.h @@ -21,10 +21,10 @@ #include "config.h" -#include #include #ifdef TEST_GUI + #include "she/she.h" #include "ui/gui.h" #endif @@ -35,17 +35,11 @@ int main(int argc, char* argv[]) { int exitcode; - ::testing::InitGoogleTest(&argc, argv); - allegro_init(); #ifdef TEST_GUI - set_color_depth(desktop_color_depth()); - set_gfx_mode(GFX_AUTODETECT_WINDOWED, 256, 256, 0, 0); - install_timer(); - install_keyboard(); - install_mouse(); { + she::ScopedHandle system(she::CreateSystem()); ui::GuiSystem guiSystem; UniquePtr manager(new ui::Manager()); #endif @@ -56,7 +50,6 @@ int main(int argc, char* argv[]) } #endif - allegro_exit(); return exitcode; }