Back to index

unity  6.0.0
test_main.cpp
Go to the documentation of this file.
00001 #include <gtest/gtest.h>
00002 #include <gio/gio.h>
00003 #include <gtk/gtk.h>
00004 #include <NuxCore/Logger.h>
00005 #include <Nux/Nux.h>
00006 
00007 #include "unity-shared/PluginAdapter.h"
00008 #include "unity-shared/WindowManager.h"
00009 
00010 int main(int argc, char** argv)
00011 {
00012   ::testing::InitGoogleTest(&argc, argv);
00013   gtk_init(&argc, &argv);
00014 
00015   nux::NuxInitialize(0);
00016   std::unique_ptr<nux::WindowThread> win_thread(nux::CreateNuxWindow("Tests",
00017                                                 300, 200, nux::WINDOWSTYLE_NORMAL,
00018                                                 NULL, false, NULL, NULL));
00019 
00020   // Slightly higher as we're more likely to test things we know will fail
00021   nux::logging::configure_logging("<root>=error");
00022 
00023   // but you can still change it if you're debugging ;)
00024   nux::logging::configure_logging(::getenv("UNITY_LOG_SEVERITY"));
00025 
00026   // Setting the PluginAdapter to null, using the Standalone version at link time.
00027   PluginAdapter::Initialize(NULL);
00028   WindowManager::SetDefault(PluginAdapter::Default());
00029 
00030   int ret = RUN_ALL_TESTS();
00031 
00032   return ret;
00033 }
00034