Name
XmlOutputter
Description
The class XmlOutputter
(see Figure C-36) is a
subclass of Outputter. It gets test results from a
TestResultCollector and outputs them in XML format
to an output stream. The write( ) method is called
to produce the output, rather than calling the other output methods
directly.
XmlOutputter defines a nested class named
Node representing an XML node.
XmlOutputter belongs to the namespace
CppUnit. It is declared in
XmlOutputter.h and implemented in
XmlOutputter.cpp.
![]() |
Declaration
class XmlOutputter : public Outputter
Constructors/Destructors
-
XmlOutputter(TestResultCollector *result, ostream &stream, string encoding = "ISO-8859-1") Constructs an
XmlOutputterto get test results fromresultand output them tostream. The default encoding is ASCII, also known as Latin-1 or ISO 8859-1.-
virtual ~XmlOutputter( ) A destructor.
Public Methods
-
virtual void addFailedTest(Test *test, TestFailure *failure, int testNumber, Node *testsNode) Creates an XML node representing the test failure and adds it to
testsNode. Also callsaddFailureLocation()if the test failure has a validSourceLine.-
virtual void addFailedTests(FailedTests &failedTests, Node *rootNode) Adds the test failures from
failedTeststorootNodeusingaddFailedTest( ).-
virtual void addFailureLocation(TestFailure *failure, Node *testNode) Creates an XML node representing the test ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access
