]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
libtls: Add support to run unit tests with a custom plugin list
authorTobias Brunner <tobias@strongswan.org>
Wed, 22 Apr 2020 14:27:00 +0000 (16:27 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 12 Feb 2021 10:45:44 +0000 (11:45 +0100)
src/libtls/tests/tls_tests.c

index 3f22f9c828a52683f936e233fa3ef71ab69c9676..87af48e701d50e70b7f22c58c677de94b9d4fbe0 100644 (file)
@@ -35,8 +35,13 @@ static bool test_runner_init(bool init)
 {
        if (init)
        {
-               plugin_loader_add_plugindirs(PLUGINDIR, PLUGINS);
-               if (!lib->plugins->load(lib->plugins, PLUGINS))
+               char *plugins;
+
+               plugins = getenv("TESTS_PLUGINS") ?:
+                                       lib->settings->get_str(lib->settings,
+                                                                               "tests.load", PLUGINS);
+               plugin_loader_add_plugindirs(PLUGINDIR, plugins);
+               if (!lib->plugins->load(lib->plugins, plugins))
                {
                        return FALSE;
                }