diff options
author | Yves-Alexis Perez <corsac@debian.org> | 2015-06-01 14:46:30 +0200 |
---|---|---|
committer | Yves-Alexis Perez <corsac@debian.org> | 2015-06-01 14:46:30 +0200 |
commit | fc556ec2bc92a9d476c11406fad2c33db8bf7cb0 (patch) | |
tree | 7360889e50de867d72741213d534a756c73902c8 /src/libstrongswan/tests/test_runner.c | |
parent | 83b8aebb19fe6e49e13a05d4e8f5ab9a06177642 (diff) | |
download | vyos-strongswan-fc556ec2bc92a9d476c11406fad2c33db8bf7cb0.tar.gz vyos-strongswan-fc556ec2bc92a9d476c11406fad2c33db8bf7cb0.zip |
Imported Upstream version 5.3.1
Diffstat (limited to 'src/libstrongswan/tests/test_runner.c')
-rw-r--r-- | src/libstrongswan/tests/test_runner.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/libstrongswan/tests/test_runner.c b/src/libstrongswan/tests/test_runner.c index b77302820..0bae9c8cd 100644 --- a/src/libstrongswan/tests/test_runner.c +++ b/src/libstrongswan/tests/test_runner.c @@ -185,6 +185,7 @@ static bool run_test(test_function_t *tfun, int i) tfun->cb(i); return TRUE; } + thread_cleanup_popall(); return FALSE; } @@ -219,6 +220,7 @@ static bool call_fixture(test_case_t *tcase, bool up) } else { + thread_cleanup_popall(); failure = TRUE; break; } @@ -233,9 +235,6 @@ static bool call_fixture(test_case_t *tcase, bool up) */ static bool pre_test(test_runner_init_t init, char *cfg) { - level_t level = LEVEL_SILENT; - char *verbosity; - library_init(cfg, "test-runner"); /* use non-blocking RNG to generate keys fast */ @@ -258,12 +257,6 @@ static bool pre_test(test_runner_init_t init, char *cfg) library_deinit(); return FALSE; } - verbosity = getenv("TESTS_VERBOSITY"); - if (verbosity) - { - level = atoi(verbosity); - } - dbg_default_set_level(level); return TRUE; } @@ -336,6 +329,7 @@ static bool post_test(test_runner_init_t init, bool check_leaks, } else { + thread_cleanup_popall(); library_deinit(); return FALSE; } @@ -529,7 +523,8 @@ int test_runner_run(const char *name, test_configuration_t configs[], test_suite_t *suite; enumerator_t *enumerator; int passed = 0, result; - char *cfg; + level_t level = LEVEL_SILENT; + char *cfg, *verbosity; /* redirect all output to stderr (to redirect make's stdout to /dev/null) */ dup2(2, 1); @@ -542,6 +537,13 @@ int test_runner_run(const char *name, test_configuration_t configs[], return EXIT_FAILURE; } + verbosity = getenv("TESTS_VERBOSITY"); + if (verbosity) + { + level = atoi(verbosity); + } + dbg_default_set_level(level); + fprintf(stderr, "Running %u '%s' test suites:\n", array_count(suites), name); enumerator = array_create_enumerator(suites); |