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.
This commit is contained in:
Tobias Brunner
2014-03-20 15:49:05 +01:00
parent 77603e98a3
commit 5dd638f45c
+9 -1
View File
@@ -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;
}