From 579dca07502f4d09fea3cc71500187b66261366f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 5 Jan 2018 15:19:09 +0200 Subject: [PATCH] Log to stdout in unit tests The log manager will log to stdout to work around directory and file permissions. --- server/core/test/test_utils.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server/core/test/test_utils.h b/server/core/test/test_utils.h index 5c00c724c..1de1f9059 100644 --- a/server/core/test/test_utils.h +++ b/server/core/test/test_utils.h @@ -22,20 +22,21 @@ #include #include +#include + #include "../maxscale/poll.h" #include "../maxscale/statistics.h" void init_test_env(char *path) { - int argc = 3; - - const char* logdir = path ? path : TEST_LOG_DIR; - config_get_global_options()->n_threads = 1; ts_stats_init(); - mxs_log_init(NULL, logdir, MXS_LOG_TARGET_DEFAULT); + if (!mxs_log_init(NULL, NULL, MXS_LOG_TARGET_STDOUT)) + { + exit(1); + } dcb_global_init(); qc_setup(NULL, NULL); qc_process_init(QC_INIT_BOTH);