]> source.dussan.org Git - rspamd.git/commitdiff
Fixed threading for testing suite.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 5 Mar 2012 14:58:50 +0000 (18:58 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 5 Mar 2012 14:58:50 +0000 (18:58 +0400)
test/CMakeLists.txt
test/rspamd_test_suite.c

index f63f6402b7d2df4991166359acd2b3881d991d02..5e20e25e4bcb06a92b29ebc0f2a1102bf8c94c14 100644 (file)
@@ -14,6 +14,7 @@ SET_TARGET_PROPERTIES(rspamd-test PROPERTIES COMPILE_FLAGS "-DRSPAMD_TEST")
 TARGET_LINK_LIBRARIES(rspamd-test rspamd_lua)
 TARGET_LINK_LIBRARIES(rspamd-test rspamdserver)
 TARGET_LINK_LIBRARIES(rspamd-test event)
+TARGET_LINK_LIBRARIES(rspamd-test m)
 TARGET_LINK_LIBRARIES(rspamd-test ${GLIB2_LIBRARIES})
 TARGET_LINK_LIBRARIES(rspamd-test ${CMAKE_REQUIRED_LIBRARIES})
 IF(HAVE_LIBEVENT2)
@@ -32,4 +33,4 @@ IF(ENABLE_LUAJIT MATCHES "ON")
     TARGET_LINK_LIBRARIES(rspamd-test "${LUAJIT_LIBRARY}")
 ELSE(ENABLE_LUAJIT MATCHES "ON")
     TARGET_LINK_LIBRARIES(rspamd-test "${LUA_LIBRARY}")
-ENDIF(ENABLE_LUAJIT MATCHES "ON")
\ No newline at end of file
+ENDIF(ENABLE_LUAJIT MATCHES "ON")
index c23f6fca201bf5db4d55ae5c42fb06b93884a23c..5f9a770971536de7d423a12268a82efb3ee8c582 100644 (file)
@@ -34,6 +34,11 @@ main (int argc, char **argv)
        g_test_init (&argc, &argv, NULL);
 
        rspamd_main = (struct rspamd_main *)g_malloc (sizeof (struct rspamd_main));
+
+#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION <= 30))
+       g_thread_init (NULL);
+#endif
+
        memset (rspamd_main, 0, sizeof (struct rspamd_main));
        rspamd_main->server_pool = memory_pool_new (memory_pool_get_size ());
        rspamd_main->cfg = (struct config_file *)g_malloc (sizeof (struct config_file));