]> git.ipfire.org Git - people/ms/strongswan.git/commitdiff
unit-tests: Add a TESTS_PLUGINS environment variable
authorMartin Willi <martin@revosec.ch>
Mon, 13 Apr 2015 09:36:05 +0000 (11:36 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 15 Apr 2015 12:38:42 +0000 (14:38 +0200)
This is often more convenient than specifying plugins in a configuration file.

src/libstrongswan/tests/test_runner.h
src/libstrongswan/tests/tests.c

index 7250f8a00123a2b9a3b56dca2d9cfe3be46ca474..5c305709641381f97438684e5de9d17ff259155d 100644 (file)
@@ -69,10 +69,14 @@ struct test_configuration_t {
  *
  * - TESTS_VERBOSITY: Numerical loglevel for debug log
  * - TESTS_STRONGSWAN_CONF: Specify a path to a custom strongswan.conf
+ * - TESTS_PLUGINS: Specify an explicit list of plugins to load
  * - TESTS_SUITES: Run specific test suites only
  * - TESTS_SUITES_EXCLUDE: Don't run specific test suites
  * - TESTS_REDUCED_KEYLENGTHS: Test minimal keylengths for public key tests only
  *
+ * Please note that TESTS_PLUGINS actually must be implemented by the init
+ * callback function, as plugin loading is delegated.
+ *
  * @param name                 name of test runner
  * @param config               test suite constructors with dependencies
  * @param init_cb              init/deinit callback
index d95ddd9d558258ca79a6c2b42f3c7e1fd3356da5..aed600fbc4eb662a94bc9f382a20ce85b55fe984 100644 (file)
@@ -37,7 +37,8 @@ static bool test_runner_init(bool init)
        {
                char *plugins, *plugindir;
 
-               plugins = lib->settings->get_str(lib->settings,
+               plugins = getenv("TESTS_PLUGINS") ?:
+                                       lib->settings->get_str(lib->settings,
                                                                                "tests.load", PLUGINS);
                plugindir = lib->settings->get_str(lib->settings,
                                                                                "tests.plugindir", PLUGINDIR);