From: Tobias Brunner Date: Fri, 14 Mar 2014 08:41:50 +0000 (+0100) Subject: unit-tests: Add an option to increase the verbosity when running tests X-Git-Tag: 5.1.3dr1~5^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5dd638f45c374eb69b4d644e9de28cb3d34d1e42;p=thirdparty%2Fstrongswan.git unit-tests: Add an option to increase the verbosity when running tests The TESTS_VERBOSITY option takes an integer from -1 to 4 that sets the default debug level. --- diff --git a/src/libstrongswan/tests/test_runner.c b/src/libstrongswan/tests/test_runner.c index 0b8830df48..6bb1b290cf 100644 --- a/src/libstrongswan/tests/test_runner.c +++ b/src/libstrongswan/tests/test_runner.c @@ -228,6 +228,9 @@ static bool call_fixture(test_case_t *tcase, bool up) */ static bool pre_test(test_runner_init_t init) { + level_t level = LEVEL_SILENT; + char *verbosity; + library_init(NULL, "test-runner"); /* use non-blocking RNG to generate keys fast */ @@ -250,7 +253,12 @@ static bool pre_test(test_runner_init_t init) library_deinit(); return FALSE; } - dbg_default_set_level(LEVEL_SILENT); + verbosity = getenv("TESTS_VERBOSITY"); + if (verbosity) + { + level = atoi(verbosity); + } + dbg_default_set_level(level); return TRUE; }