incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject svn commit: r1174831 - /incubator/ooo/trunk/main/sal/cppunittester/cppunittester.cxx
Date Fri, 23 Sep 2011 15:19:57 GMT
Author: hdu
Date: Fri Sep 23 15:19:56 2011
New Revision: 1174831

URL: http://svn.apache.org/viewvc?rev=1174831&view=rev
Log:
make exceptions for cppunittester verbose

Modified:
    incubator/ooo/trunk/main/sal/cppunittester/cppunittester.cxx

Modified: incubator/ooo/trunk/main/sal/cppunittester/cppunittester.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sal/cppunittester/cppunittester.cxx?rev=1174831&r1=1174830&r2=1174831&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sal/cppunittester/cppunittester.cxx (original)
+++ incubator/ooo/trunk/main/sal/cppunittester/cppunittester.cxx Fri Sep 23 15:19:56 2011
@@ -53,6 +53,7 @@
 #include "cppunit/extensions/TestFactoryRegistry.h"
 #include "cppunit/plugin/PlugInManager.h"
 #include "cppunit/portability/Stream.h"
+#include "cppunit/plugin/DynamicLibraryManagerException.h"
 #include "postextstl.h"
 
 namespace {
@@ -131,13 +132,21 @@ SAL_IMPLEMENT_MAIN() {
     if (rtl_getAppCommandArgCount() - index != 1) {
         usageFailure();
     }
-    CppUnit::PlugInManager manager;
-    manager.load(convertStrict(getArgument(index)));
-    CppUnit::TestRunner runner;
-    runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
-    CppUnit::TestResultCollector collector;
-    result.addListener(&collector);
-    runner.run(result);
-    CppUnit::CompilerOutputter(&collector, CppUnit::stdCErr()).write();
-    return collector.wasSuccessful() ? EXIT_SUCCESS : EXIT_FAILURE;
+
+	bool bSuccess = false;
+	try {
+		CppUnit::PlugInManager manager;
+		manager.load(convertStrict(getArgument(index)));
+		CppUnit::TestRunner runner;
+		runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
+		CppUnit::TestResultCollector collector;
+		result.addListener(&collector);
+		runner.run(result);
+		CppUnit::CompilerOutputter(&collector, CppUnit::stdCErr()).write();
+		bSuccess = collector.wasSuccessful();
+	} catch( CppUnit::DynamicLibraryManagerException& e) {
+		std::cerr << "DynamicLibraryManagerException: \"" << e.what() << "\"\n";
+	}
+	
+    return bSuccess ? EXIT_SUCCESS : EXIT_FAILURE;
 }



Mime
View raw message