fix the plugin loading test to suit the new dir layout
the 'missing path' test still works, but rather accidentally: the plugin search path retrieved from resolving $ORIGIN is an absolute path, while this test uses relative paths; thus the querried plugin won't be found. In the second test, we set an environment override, using the relative path (which is now 'modules'). Thus the discovery works.
This commit is contained in:
parent
35380e7873
commit
bc1c89639d
3 changed files with 12 additions and 6 deletions
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
gui = gtk_gui.lum
|
||||
modulepath = $ORIGIN/modules
|
||||
configpath = /usr/share/lumiera/config:~/.lumiera
|
||||
configpath = $ORIGIN/../../share/lumiera/config:~/.lumiera
|
||||
title = Lumiera
|
||||
version = 0.pre.01
|
||||
website = http://www.lumiera.org
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ return: 0
|
|||
END
|
||||
|
||||
TEST "plugin unloading" plugin_unload <<END
|
||||
out: plugin unload: \(nil\)
|
||||
out: plugin discovered before unload: 0x..
|
||||
out: plugin discovered after unload: \(nil\)
|
||||
return: 0
|
||||
END
|
||||
|
||||
|
|
|
|||
|
|
@ -465,7 +465,7 @@ TEST (plugin_discover)
|
|||
|
||||
if (lumiera_plugin_discover (lumiera_plugin_load, lumiera_plugin_register))
|
||||
{
|
||||
LumieraPlugin p = lumiera_plugin_lookup (".libs/examplepluginc.lum");
|
||||
LumieraPlugin p = lumiera_plugin_lookup ("modules/examplepluginc.lum");
|
||||
printf ("found plugin: %s\n", lumiera_plugin_name (p));
|
||||
lumiera_plugin_discover (lumiera_plugin_load, lumiera_plugin_register);
|
||||
}
|
||||
|
|
@ -482,9 +482,14 @@ TEST (plugin_unload)
|
|||
lumiera_interfaceregistry_init ();
|
||||
|
||||
lumiera_plugin_discover (lumiera_plugin_load, lumiera_plugin_register);
|
||||
lumiera_plugin_unload (lumiera_plugin_lookup (".libs/examplepluginc.so"));
|
||||
LumieraPlugin p = lumiera_plugin_lookup (".libs/examplepluginc.so");
|
||||
printf ("plugin unload: %p\n", p);
|
||||
LumieraPlugin p = lumiera_plugin_lookup ("modules/examplepluginc.lum");
|
||||
printf ("plugin discovered before unload: %p\n", p);
|
||||
CHECK (p, "prerequisite: need to load examplepluginc.lum");
|
||||
|
||||
lumiera_plugin_unload (lumiera_plugin_lookup ("modules/examplepluginc.lum"));
|
||||
p = lumiera_plugin_lookup ("examplepluginc.lum");
|
||||
printf ("plugin discovered after unload: %p\n", p);
|
||||
CHECK (!p, "failed to unload plugin.");
|
||||
|
||||
lumiera_interfaceregistry_destroy ();
|
||||
lumiera_config_destroy ();
|
||||
|
|
|
|||
Loading…
Reference in a new issue