unit-tests: Support strongswan.conf defined plugin list and base directory
[strongswan.git] / src / libstrongswan / tests / tests.c
index c3f43e7..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;
                }
@@ -52,5 +58,5 @@ static bool test_runner_init(bool init)
 
 int main(int argc, char *argv[])
 {
-       return test_runner_run(tests, test_runner_init);
+       return test_runner_run("libstrongswan", tests, test_runner_init);
 }