From: Tobias Brunner Date: Tue, 25 Jun 2013 17:42:34 +0000 (+0200) Subject: tests: Properly load plugins from build directory X-Git-Tag: 5.1.0dr1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65d23c7c90ec54b0f9445c65b7279dab133d53bf;p=thirdparty%2Fstrongswan.git tests: Properly load plugins from build directory Calling load() incrementally does not really work as dependencies wouldn't be resolved properly if a required feature was to be provided by a plugin that is loaded later with a separate call to load(). --- diff --git a/src/libstrongswan/tests/test_runner.c b/src/libstrongswan/tests/test_runner.c index c80f9fc2e5..2cd73a3cc3 100644 --- a/src/libstrongswan/tests/test_runner.c +++ b/src/libstrongswan/tests/test_runner.c @@ -29,7 +29,6 @@ static bool load_plugins() { enumerator_t *enumerator; char *name, path[PATH_MAX], dir[64]; - bool success = TRUE; enumerator = enumerator_create_token(PLUGINS, " ", ""); while (enumerator->enumerate(enumerator, &name)) @@ -37,15 +36,11 @@ static bool load_plugins() snprintf(dir, sizeof(dir), "%s", name); translate(dir, "-", "_"); snprintf(path, sizeof(path), "%s/%s/.libs", PLUGINDIR, dir); - if (!lib->plugins->load(lib->plugins, path, name)) - { - success = FALSE; - break; - } + lib->plugins->add_path(lib->plugins, path); } enumerator->destroy(enumerator); - return success; + return lib->plugins->load(lib->plugins, NULL, PLUGINS); } int main()