summaryrefslogtreecommitdiff
path: root/c++/README
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2009-10-03 23:33:53 +1000
committerRobert Collins <robertc@robertcollins.net>2009-10-03 23:33:53 +1000
commit493a10dc9146e4ea9dd98ca69fe658a8139f35fc (patch)
tree6b8b21aa693bd783626ca3cec772fd1f987b678c /c++/README
parenta0fece2a82603e4cc7037313795b08e937e8a758 (diff)
downloadsubunit-git-493a10dc9146e4ea9dd98ca69fe658a8139f35fc.tar.gz
Move the C++ Listener from a patch against cppunit to a usable external module for cppunit.
Diffstat (limited to 'c++/README')
-rw-r--r--c++/README59
1 files changed, 30 insertions, 29 deletions
diff --git a/c++/README b/c++/README
index 3fd085c..7b81844 100644
--- a/c++/README
+++ b/c++/README
@@ -18,32 +18,33 @@
#
Currently there are no native C++ bindings for subunit. However the C library
-can be used from C++ safely. There is also a patch for cppunit
-(http://cppunit.sourceforge.net/) to enable reporting via subunit
-(cppunit-subunit-1.10.2.patch).
-
-To use the patch, apply it and rebuild your cppunit. Then in your main do
-{
- // Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // Add a listener that collects test result
- // so we can get the overall status.
- // note this isn't needed for subunit...
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // Add a listener that print test activity in subunit format.
- CPPUNIT_NS::SubunitTestProgressListener progress;
- controller.addListener( &progress );
-
- // Add the top suite to the test runner
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
- runner.run( controller );
-
- return result.wasSuccessful() ? 0 : 1;
-}
-
-
-See the c/README for documentation on the C bindings for subunit.
+can be used from C++ safely. A CPPUnit listener is built as part of Subunit to
+allow CPPUnit users to simply get Subunit output.
+
+To use the listener, use pkg-config (or your preferred replacement) to get the
+cflags and link settings from libcppunit_subunit.pc.
+
+In your test driver main, use SubunitTestProgressListener, as shown in this
+example main::
+
+ {
+ // Create the event manager and test controller
+ CPPUNIT_NS::TestResult controller;
+
+ // Add a listener that collects test result
+ // so we can get the overall status.
+ // note this isn't needed for subunit...
+ CPPUNIT_NS::TestResultCollector result;
+ controller.addListener( &result );
+
+ // Add a listener that print test activity in subunit format.
+ CPPUNIT_NS::SubunitTestProgressListener progress;
+ controller.addListener( &progress );
+
+ // Add the top suite to the test runner
+ CPPUNIT_NS::TestRunner runner;
+ runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
+ runner.run( controller );
+
+ return result.wasSuccessful() ? 0 : 1;
+ }