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().
This commit is contained in:
@@ -29,7 +29,6 @@ static bool load_plugins()
|
|||||||
{
|
{
|
||||||
enumerator_t *enumerator;
|
enumerator_t *enumerator;
|
||||||
char *name, path[PATH_MAX], dir[64];
|
char *name, path[PATH_MAX], dir[64];
|
||||||
bool success = TRUE;
|
|
||||||
|
|
||||||
enumerator = enumerator_create_token(PLUGINS, " ", "");
|
enumerator = enumerator_create_token(PLUGINS, " ", "");
|
||||||
while (enumerator->enumerate(enumerator, &name))
|
while (enumerator->enumerate(enumerator, &name))
|
||||||
@@ -37,15 +36,11 @@ static bool load_plugins()
|
|||||||
snprintf(dir, sizeof(dir), "%s", name);
|
snprintf(dir, sizeof(dir), "%s", name);
|
||||||
translate(dir, "-", "_");
|
translate(dir, "-", "_");
|
||||||
snprintf(path, sizeof(path), "%s/%s/.libs", PLUGINDIR, dir);
|
snprintf(path, sizeof(path), "%s/%s/.libs", PLUGINDIR, dir);
|
||||||
if (!lib->plugins->load(lib->plugins, path, name))
|
lib->plugins->add_path(lib->plugins, path);
|
||||||
{
|
|
||||||
success = FALSE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
enumerator->destroy(enumerator);
|
enumerator->destroy(enumerator);
|
||||||
|
|
||||||
return success;
|
return lib->plugins->load(lib->plugins, NULL, PLUGINS);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
|||||||
Reference in New Issue
Block a user