aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-03-05 18:58:50 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-03-05 18:58:50 +0400
commit448ba92d15341362bdf4701e9b07f1503458d28f (patch)
tree64ffd785da104a844c4e79b317d65d8cf42fcc67
parent4f28edb3f55048024301068417be00106ebdd09a (diff)
downloadrspamd-448ba92d15341362bdf4701e9b07f1503458d28f.tar.gz
rspamd-448ba92d15341362bdf4701e9b07f1503458d28f.zip
Fixed threading for testing suite.
-rw-r--r--test/CMakeLists.txt3
-rw-r--r--test/rspamd_test_suite.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index f63f6402b..5e20e25e4 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -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")
diff --git a/test/rspamd_test_suite.c b/test/rspamd_test_suite.c
index c23f6fca2..5f9a77097 100644
--- a/test/rspamd_test_suite.c
+++ b/test/rspamd_test_suite.c
@@ -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));