aboutsummaryrefslogtreecommitdiffstats
path: root/test/rspamd_test_suite.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-08-21 15:12:24 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-08-21 15:12:24 +0100
commit5607e21b22008b2f23d9f86aeeb0562f8a6671b8 (patch)
tree1aff1b4ed40949ad4af0b7c77600207143b30335 /test/rspamd_test_suite.c
parentf553ed3830c57309ed0321edf7b6c72cf9ff7525 (diff)
downloadrspamd-5607e21b22008b2f23d9f86aeeb0562f8a6671b8.tar.gz
rspamd-5607e21b22008b2f23d9f86aeeb0562f8a6671b8.zip
Improve test suite by using standard glib test options.
Diffstat (limited to 'test/rspamd_test_suite.c')
-rw-r--r--test/rspamd_test_suite.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/test/rspamd_test_suite.c b/test/rspamd_test_suite.c
index d249ee1fe..7fb655347 100644
--- a/test/rspamd_test_suite.c
+++ b/test/rspamd_test_suite.c
@@ -3,36 +3,20 @@
#include "../src/cfg_file.h"
#include "tests.h"
-static gboolean do_debug;
struct rspamd_main *rspamd_main = NULL;
struct event_base *base = NULL;
worker_t *workers[] = { NULL };
-static GOptionEntry entries[] =
-{
- { "debug", 'd', 0, G_OPTION_ARG_NONE, &do_debug, "Turn on debug messages", NULL },
- { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
-};
int
main (int argc, char **argv)
{
struct config_file *cfg;
- GError *error = NULL;
- GOptionContext *context;
-
- context = g_option_context_new ("- run rspamd test suite");
- g_option_context_set_summary (context, "Summary:\n Rspamd test suite version " RVERSION);
- g_option_context_add_main_entries (context, entries, NULL);
- if (!g_option_context_parse (context, &argc, &argv, &error)) {
- fprintf (stderr, "option parsing failed: %s\n", error->message);
- exit (1);
- }
-
- g_mem_set_vtable(glib_mem_profiler_table);
g_test_init (&argc, &argv, NULL);
+ g_mem_set_vtable (glib_mem_profiler_table);
+
rspamd_main = (struct rspamd_main *)g_malloc (sizeof (struct rspamd_main));
#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION <= 30))
@@ -48,7 +32,7 @@ main (int argc, char **argv)
base = event_init ();
- if (do_debug) {
+ if (g_test_verbose ()) {
cfg->log_level = G_LOG_LEVEL_DEBUG;
}
else {