mirror of
https://github.com/strongswan/strongswan.git
synced 2025-11-28 00:00:40 -05:00
unit-tests: Load libstrongswan plugins in libcharon tests
This commit is contained in:
parent
fe5d6eaa9f
commit
88d90c7b4b
@ -11,6 +11,8 @@ libcharon_tests_CFLAGS = \
|
||||
-I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libstrongswan/tests \
|
||||
-DPLUGINDIR=\""$(abs_top_builddir)/src/libstrongswan/plugins\"" \
|
||||
-DPLUGINS=\""${s_plugins}\"" \
|
||||
@COVERAGE_CFLAGS@
|
||||
|
||||
libcharon_tests_LDFLAGS = @COVERAGE_LDFLAGS@
|
||||
|
||||
@ -37,13 +37,27 @@ static bool test_runner_init(bool init)
|
||||
{
|
||||
if (init)
|
||||
{
|
||||
char *plugins, *plugindir;
|
||||
|
||||
libhydra_init();
|
||||
libcharon_init();
|
||||
|
||||
plugins = getenv("TESTS_PLUGINS") ?:
|
||||
lib->settings->get_str(lib->settings,
|
||||
"tests.load", PLUGINS);
|
||||
plugindir = lib->settings->get_str(lib->settings,
|
||||
"tests.plugindir", PLUGINDIR);
|
||||
plugin_loader_add_plugindirs(plugindir, plugins);
|
||||
if (!lib->plugins->load(lib->plugins, plugins))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lib->processor->set_threads(lib->processor, 0);
|
||||
lib->processor->cancel(lib->processor);
|
||||
lib->plugins->unload(lib->plugins);
|
||||
libcharon_deinit();
|
||||
libhydra_deinit();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user