diff options
author | Tobias Brunner <tobias@strongswan.org> | 2014-03-14 09:41:50 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2014-03-20 15:49:05 +0100 |
commit | 5dd638f45c374eb69b4d644e9de28cb3d34d1e42 (patch) | |
tree | c5771f07d5990380974c59665d0ab51879d61773 /src | |
parent | 77603e98a38dc4b88bab934c77edabe8267a6907 (diff) | |
download | strongswan-5dd638f45c374eb69b4d644e9de28cb3d34d1e42.tar.bz2 strongswan-5dd638f45c374eb69b4d644e9de28cb3d34d1e42.tar.xz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/libstrongswan/tests/test_runner.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libstrongswan/tests/test_runner.c b/src/libstrongswan/tests/test_runner.c index 0b8830df4..6bb1b290c 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; } |