Share

CppUnit - C++ port of JUnit

Tracker: Patches

5 add support for subunit - ID: 2836763
Last Update: Settings changed ( rbcollins )

This adds SubunitTestProgressListener, which allows outputting test
progress via subunit (https://launchpad.net/subunit). Iwrote this ages ago
and just realised I hadn't submitted it upstream.
---
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 prints 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;
}
---


Robert Collins ( rbcollins ) - 2009-08-13 07:41

5

Deleted

Duplicate

Nobody/Anonymous

test output

None

Public


Comment ( 1 )

Date: 2009-08-13 07:45
Sender: rbcollins

Duplicate with 1471357 which I did in fact file. I just couldn't easily
find it in the sf interface.


Attached File ( 1 )

Filename Description Download
cppunit-subunit-1.10.2.patch SubunitTestProgressListener - subunit support Download

Changes ( 5 )

Field Old Value Date By
close_date - 2009-08-13 07:51 rbcollins
allow_comments 1 2009-08-13 07:51 rbcollins
status_id Open 2009-08-13 07:51 rbcollins
resolution_id None 2009-08-13 07:45 rbcollins
File Added 338995: cppunit-subunit-1.10.2.patch 2009-08-13 07:41 rbcollins