unit-tests: Support strongswan.conf defined plugin list and base directory
[strongswan.git] / src / libstrongswan / tests / tests.c
index 9f2adfd..d95ddd9 100644 (file)
@@ -35,8 +35,14 @@ static bool test_runner_init(bool init)
 {
        if (init)
        {
-               plugin_loader_add_plugindirs(PLUGINDIR, PLUGINS);
-               if (!lib->plugins->load(lib->plugins, PLUGINS))
+               char *plugins, *plugindir;
+
+               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;
                }