summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/rspamd_cxx_unit.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/rspamd_cxx_unit.cxx b/test/rspamd_cxx_unit.cxx
index eb456d2fd..fedf453c3 100644
--- a/test/rspamd_cxx_unit.cxx
+++ b/test/rspamd_cxx_unit.cxx
@@ -15,12 +15,27 @@
*/
#include "config.h"
+#include "rspamd.h"
+#include <memory>
#define DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL
#include "doctest/doctest.h"
int
main(int argc, char** argv)
{
+ std::unique_ptr<struct rspamd_main> rspamd_main{new struct rspamd_main};
+ struct rspamd_config *cfg;
+
+ rspamd_main->server_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL, 0);
+ cfg = rspamd_config_new (RSPAMD_CONFIG_INIT_DEFAULT);
+ cfg->libs_ctx = rspamd_init_libs ();
+ rspamd_main->cfg = cfg;
+ cfg->cfg_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL, 0);
+
+ rspamd_main->logger = rspamd_log_open_emergency (rspamd_main->server_pool,
+ RSPAMD_LOG_FLAG_RSPAMADM);
+ rspamd_log_set_log_level (rspamd_main->logger, G_LOG_LEVEL_MESSAGE);
+
doctest::Context context(argc, argv);
int res = context.run();