summaryrefslogtreecommitdiff
path: root/src/libcharon/tests/libcharon_tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcharon/tests/libcharon_tests.c')
-rw-r--r--src/libcharon/tests/libcharon_tests.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libcharon/tests/libcharon_tests.c b/src/libcharon/tests/libcharon_tests.c
index e25e5434f..1ef13e978 100644
--- a/src/libcharon/tests/libcharon_tests.c
+++ b/src/libcharon/tests/libcharon_tests.c
@@ -32,6 +32,22 @@ static test_configuration_t tests[] = {
{ .suite = NULL, }
};
+static void initialize_logging()
+{
+ int level = LEVEL_SILENT;
+ char *verbosity;
+
+ verbosity = getenv("TESTS_VERBOSITY");
+ if (verbosity)
+ {
+ level = atoi(verbosity);
+ }
+ lib->settings->set_int(lib->settings, "%s.filelog.stderr.default",
+ lib->settings->get_int(lib->settings, "%s.filelog.stderr.default",
+ level, lib->ns), lib->ns);
+ charon->load_loggers(charon, NULL, TRUE);
+}
+
static bool test_runner_init(bool init)
{
if (init)
@@ -39,6 +55,7 @@ static bool test_runner_init(bool init)
char *plugins, *plugindir;
libcharon_init();
+ initialize_logging();
plugins = getenv("TESTS_PLUGINS") ?:
lib->settings->get_str(lib->settings,