Improve error message when failing to activate a plugin.

Also fix a unit test helper script that checks plugin availability.
This commit is contained in:
Jon Siwek 2014-09-16 10:09:46 -05:00
parent a7373a1ca4
commit d342cde22c
2 changed files with 8 additions and 2 deletions

View file

@ -850,9 +850,15 @@ int main(int argc, char** argv)
file_mgr->InitPreScript();
broxygen_mgr->InitPreScript();
bool missing_plugin = false;
for ( set<string>::const_iterator i = requested_plugins.begin();
i != requested_plugins.end(); i++ )
plugin_mgr->ActivateDynamicPlugin(*i);
if ( ! plugin_mgr->ActivateDynamicPlugin(*i) )
missing_plugin = true;
if ( missing_plugin )
reporter->FatalError("Failed to activate requested dynamic plugins.");
plugin_mgr->ActivateDynamicPlugins(! bare_mode);

View file

@ -3,4 +3,4 @@
# Returns true if Bro has been compiled with support for writer type
# $1. The type name must match the plugin name that "bro -N" prints.
bro -N $1 >/dev/null
bro -N | grep -q $1 >/dev/null