int main(int ac, char **av) { ThreadData td; td.argc = ac; td.argv = av; td.testResult = 0; DEBUG_CONF("ut_cangenplugin", #ifdef _DEBUG CUtil::Logger::file_on|CUtil::Logger::screen_on, #else CUtil::Logger::file_on|CUtil::Logger::screen_off, #endif CUtil::Logger::EInfo, CUtil::Logger::EWarning); td.mainLoop = g_main_loop_new(NULL, FALSE); // Run the mainloop and the tests thread GThread* testThread = g_thread_new("tests thread", &tests_thread, &td); g_main_loop_run(td.mainLoop); g_thread_join(testThread); g_main_loop_unref(td.mainLoop); return td.testResult; }
// library exported function for plugin loader extern "C" AbstractSource* create(AbstractRoutingEngine* routingengine, std::map<std::string, std::string> config) { #ifndef UNIT_TESTS DEBUG_CONF("cangenplugin", CUtil::Logger::file_off|CUtil::Logger::screen_on, CUtil::Logger::EInfo, CUtil::Logger::EInfo ); #endif std::unique_ptr< AmbPlugin<CANGenPlugin> > plugin(new AmbPlugin<CANGenPlugin>(routingengine, config)); plugin->init(); return plugin.release(); }