Handle CppUnit::DynamicLibraryManagerException

Change-Id: I81f9b133ffb03c225b276639f60ad5e7f38ec1ef
This commit is contained in:
Tor Lillqvist 2012-08-17 20:21:05 +03:00
parent b2315f6b7b
commit d3721e5000

View File

@ -53,6 +53,7 @@
#include "cppunit/TestRunner.h" #include "cppunit/TestRunner.h"
#include "cppunit/extensions/TestFactoryRegistry.h" #include "cppunit/extensions/TestFactoryRegistry.h"
#include "cppunit/plugin/PlugInManager.h" #include "cppunit/plugin/PlugInManager.h"
#include "cppunit/plugin/DynamicLibraryManagerException.h"
#include "cppunit/portability/Stream.h" #include "cppunit/portability/Stream.h"
#include "boost/noncopyable.hpp" #include "boost/noncopyable.hpp"
@ -137,7 +138,12 @@ public:
// we statically link to the app executable. // we statically link to the app executable.
#else #else
CppUnit::PlugInManager manager; CppUnit::PlugInManager manager;
manager.load(testlib, args); try {
manager.load(testlib, args);
} catch (const CppUnit::DynamicLibraryManagerException &e) {
fprintf(stderr, "%s\n", e.what());
return false;
}
#endif #endif
CppUnit::TestRunner runner; CppUnit::TestRunner runner;
runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());