aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/tests/test_runner.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/tests/test_runner.c')
-rw-r--r--src/libstrongswan/tests/test_runner.c33
1 files changed, 8 insertions, 25 deletions
diff --git a/src/libstrongswan/tests/test_runner.c b/src/libstrongswan/tests/test_runner.c
index 1f11050f4..443c0ae13 100644
--- a/src/libstrongswan/tests/test_runner.c
+++ b/src/libstrongswan/tests/test_runner.c
@@ -18,6 +18,7 @@
#include "test_runner.h"
#include <library.h>
+#include <threading/thread.h>
#include <plugins/plugin_feature.h>
#include <collections/array.h>
#include <utils/test.h>
@@ -34,32 +35,12 @@
#define TTY(color) tty_escape_get(2, TTY_FG_##color)
/**
- * Initialize the lookup table for testable functions (defined in
- * libstrongswan). We don't use the constructor attribute as the order can't
- * really be defined (clang does not support it and gcc does not adhere to it in
- * the monolithic build). The function here is a weak symbol in libstrongswan.
+ * A global symbol indicating libtest linkage
*/
-void testable_functions_create()
-{
- if (!testable_functions)
- {
- testable_functions = hashtable_create(hashtable_hash_str,
- hashtable_equals_str, 8);
- }
-}
-
-/**
- * Destroy the lookup table for testable functions
- */
-static void testable_functions_destroy() __attribute__ ((destructor));
-static void testable_functions_destroy()
-{
- DESTROY_IF(testable_functions);
- /* if leak detective is enabled plugins are not actually unloaded, which
- * means their destructor is called AFTER this one when the process
- * terminates, make sure this does not crash */
- testable_functions = NULL;
-}
+#ifdef WIN32
+__declspec(dllexport)
+#endif
+bool test_runner_available = TRUE;
/**
* Destroy a single test suite and associated data
@@ -372,6 +353,7 @@ static void print_failures(array_t *failures)
{
failure_t failure;
+ threads_init();
backtrace_init();
while (array_remove(failures, 0, &failure))
@@ -391,6 +373,7 @@ static void print_failures(array_t *failures)
}
backtrace_deinit();
+ threads_deinit();
}
/**