CppUnit project page | FAQ | CppUnit home page |
#include <XmlOutputter.h>
Inheritance diagram for XmlOutputter:
Public Types | |
typedef CppUnitMap< Test *, TestFailure *, std::less< Test * > > | FailedTests |
Public Member Functions | |
XmlOutputter (TestResultCollector *result, OStream &stream, std::string encoding=std::string("ISO-8859-1")) | |
Constructs a XmlOutputter object. | |
virtual | ~XmlOutputter () |
Destructor. | |
virtual void | addHook (XmlOutputterHook *hook) |
Adds the specified hook to the outputter. | |
virtual void | removeHook (XmlOutputterHook *hook) |
Removes the specified hook from the outputter. | |
virtual void | write () |
Writes the specified result as an XML document to the stream. | |
virtual void | setStyleSheet (const std::string &styleSheet) |
Sets the XSL style sheet used. | |
virtual void | setStandalone (bool standalone) |
set the output document as standalone or not. | |
virtual void | setRootNode () |
Sets the root element and adds its children. | |
virtual void | addFailedTests (FailedTests &failedTests, XmlElement *rootNode) |
virtual void | addSuccessfulTests (FailedTests &failedTests, XmlElement *rootNode) |
virtual void | addStatistics (XmlElement *rootNode) |
Adds the statics element to the root node. | |
virtual void | addFailedTest (Test *test, TestFailure *failure, int testNumber, XmlElement *testsNode) |
Adds a failed test to the failed tests node. Creates a new element containing datas about the failed test, and adds it to the failed tests element. Then, for all hooks, call failTestAdded(). | |
virtual void | addFailureLocation (TestFailure *failure, XmlElement *testElement) |
virtual void | addSuccessfulTest (Test *test, int testNumber, XmlElement *testsNode) |
Adds a successful test to the successful tests node. Creates a new element containing datas about the successful test, and adds it to the successful tests element. Then, for all hooks, call successfulTestAdded(). | |
Protected Types | |
typedef CppUnitDeque< XmlOutputterHook * > | Hooks |
Protected Member Functions | |
virtual void | fillFailedTestsMap (FailedTests &failedTests) |
Protected Attributes | |
TestResultCollector * | m_result |
OStream & | m_stream |
std::string | m_encoding |
std::string | m_styleSheet |
XmlDocument * | m_xml |
Hooks | m_hooks |
Private Member Functions | |
XmlOutputter (const XmlOutputter ©) | |
Prevents the use of the copy constructor. | |
void | operator= (const XmlOutputter ©) |
Prevents the use of the copy operator. |
Save the test result as a XML stream.
Additional datas can be added to the XML document using XmlOutputterHook. Hook are not owned by the XmlOutputter. They should be valid until destruction of the XmlOutputter. They can be removed with removeHook().
|
|
|
|
|
Constructs a XmlOutputter object.
|
|
Destructor.
|
|
Prevents the use of the copy constructor.
|
|
Adds a failed test to the failed tests node. Creates a new element containing datas about the failed test, and adds it to the failed tests element. Then, for all hooks, call failTestAdded().
|
|
|
|
|
|
Adds the specified hook to the outputter.
|
|
Adds the statics element to the root node. Creates a new element containing statistics data and adds it to the root element. Then, for all hooks, call statisticsAdded().
|
|
Adds a successful test to the successful tests node. Creates a new element containing datas about the successful test, and adds it to the successful tests element. Then, for all hooks, call successfulTestAdded().
|
|
|
|
|
|
Prevents the use of the copy operator.
|
|
Removes the specified hook from the outputter.
|
|
Sets the root element and adds its children. Set the root element of the XML Document and add its child elements. For all hooks, call beginDocument() just after creating the root element (it is empty at this time), and endDocument() once all the datas have been added to the root element. |
|
set the output document as standalone or not. For the output document, specify wether it's a standalone XML document, or not.
|
|
Sets the XSL style sheet used.
|
|
Writes the specified result as an XML document to the stream. Refer to examples/cppunittest/XmlOutputterTest.cpp for example of use and XML document structure. Implements Outputter. |
|
|
|
|
|
|
|
|
|
|
|
|
hosts this site. |
Send comments to: CppUnit Developers |