You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/04/20 16:24:08 UTC

svn commit: r766705 - /activemq/activemq-cpp/trunk/activemq-cpp/src/test/main.cpp

Author: tabish
Date: Mon Apr 20 14:24:08 2009
New Revision: 766705

URL: http://svn.apache.org/viewvc?rev=766705&view=rev
Log:
Test now outputs its results to an XML file as well as to the console.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/main.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/main.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/main.cpp?rev=766705&r1=766704&r2=766705&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/main.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/main.cpp Mon Apr 20 14:24:08 2009
@@ -18,6 +18,7 @@
 #include <cppunit/extensions/TestFactoryRegistry.h>
 #include <cppunit/ui/text/TestRunner.h>
 #include <cppunit/BriefTestProgressListener.h>
+#include <cppunit/XmlOutputter.h>
 #include <cppunit/TestResult.h>
 #include <activemq/util/Config.h>
 #include <activemq/library/ActiveMQCPP.h>
@@ -41,6 +42,9 @@
     }
 
     for( int i = 0; i < iterations; ++i ) {
+
+        std::ofstream outputFile( "activemq-test.xml"  );
+
         CppUnit::TextUi::TestRunner runner;
         CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry();
         runner.addTest( registry.makeTest() );
@@ -49,7 +53,13 @@
         CppUnit::BriefTestProgressListener listener;
         runner.eventManager().addListener( &listener );
 
+        // Specify XML output and inform the test runner of this format.  The TestRunner
+        // will delete the passed XmlOutputter for us.
+        runner.setOutputter( new CppUnit::XmlOutputter( &runner.result(), outputFile ) );
+
         wasSuccessful = runner.run( "", false );
+
+        outputFile.close();
     }
 
     activemq::library::ActiveMQCPP::shutdownLibrary();