aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-01-05 11:45:57 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-05 17:17:43 +0100
commit2eb8366edf353ea91ebf6d7ddc23e8fecda4a8b3 (patch)
tree255207d539315cd9a2e5ff3efebdfe3575a37cfa /test
parent15648f10d8f75d81c676bb73e4f63031896e79c7 (diff)
downloadusdx-2eb8366edf353ea91ebf6d7ddc23e8fecda4a8b3.tar.gz
usdx-2eb8366edf353ea91ebf6d7ddc23e8fecda4a8b3.tar.xz
usdx-2eb8366edf353ea91ebf6d7ddc23e8fecda4a8b3.zip
added some more output and output to test.xml
Diffstat (limited to 'test')
-rw-r--r--test/test.cpp31
1 files changed, 29 insertions, 2 deletions
diff --git a/test/test.cpp b/test/test.cpp
index 78983217..53ee3a89 100644
--- a/test/test.cpp
+++ b/test/test.cpp
@@ -24,15 +24,42 @@
* $Id$
*/
+#include <fstream>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TextTestRunner.h>
+#include <cppunit/TestResult.h>
+#include <cppunit/TestResultCollector.h>
+#include <cppunit/BriefTestProgressListener.h>
+#include <cppunit/XmlOutputter.h>
+#include <cppunit/TextOutputter.h>
int main(int argc, char **argv)
{
CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry();
+ // Create the event manager and test controller
+ CppUnit::TestResult controller;
+
+ // Add a listener that colllects test result
+ CppUnit::TestResultCollector result;
+ controller.addListener(&result);
+
+ // Add a listener that print dots as test run.
+ CppUnit::BriefTestProgressListener progress;
+ controller.addListener(&progress);
+
CppUnit::TextTestRunner runner;
runner.addTest(registry.makeTest());
- runner.run();
- return 0;
+ runner.run(controller);
+
+ CppUnit::TextOutputter outputter(&result, std::cout);
+ outputter.write();
+
+ std::fstream filestr;
+ filestr.open ("test.xml", std::fstream::out | std::fstream::trunc);
+ CppUnit::XmlOutputter xml_outputter(&result, filestr);
+ xml_outputter.write();
+ filestr.close();
+
+ return result.testFailuresTotal();
}