diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-03-15 21:04:36 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-03-15 21:04:36 +0000 |
commit | 10fb4d1a18a0a0573ad84a5ec4e5dd2ba55fdaa3 (patch) | |
tree | 6183213b35be006d9cc12adac81c0b9e01d4d3a3 /test/rspamd_cxx_unit.cxx | |
parent | 92f20993f94c91ad03213c5fcc2984ee3b487a67 (diff) | |
download | rspamd-10fb4d1a18a0a0573ad84a5ec4e5dd2ba55fdaa3.tar.gz rspamd-10fb4d1a18a0a0573ad84a5ec4e5dd2ba55fdaa3.zip |
[Project] Css: Move some of the tests to the doctest
Diffstat (limited to 'test/rspamd_cxx_unit.cxx')
-rw-r--r-- | test/rspamd_cxx_unit.cxx | 15 |
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(); |