blob: 9f155e2c42054e3809a98da588debd54912616f9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
#ifndef CPPUNITEST_XMLTESTRESULTOUTPUTTERTEST_H
#define CPPUNITEST_XMLTESTRESULTOUTPUTTERTEST_H
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/Test.h>
#include <cppunit/TestFailure.h>
#include <cppunit/TestResultCollector.h>
#include <deque>
/*! \class XmlOutputterTest
* \brief Unit tests for XmlOutputter.
*/
class XmlOutputterTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( XmlOutputterTest );
CPPUNIT_TEST( testWriteXmlResultWithNoTest );
CPPUNIT_TEST( testWriteXmlResultWithOneFailure );
CPPUNIT_TEST( testWriteXmlResultWithOneError );
CPPUNIT_TEST( testWriteXmlResultWithOneSuccess );
CPPUNIT_TEST( testWriteXmlResultWithThreeFailureTwoErrorsAndTwoSuccess );
CPPUNIT_TEST_SUITE_END();
public:
/*! Constructs a XmlOutputterTest object.
*/
XmlOutputterTest();
/// Destructor.
virtual ~XmlOutputterTest();
void setUp();
void tearDown();
void testWriteXmlResultWithNoTest();
void testWriteXmlResultWithOneFailure();
void testWriteXmlResultWithOneError();
void testWriteXmlResultWithOneSuccess();
void testWriteXmlResultWithThreeFailureTwoErrorsAndTwoSuccess();
private:
/// Prevents the use of the copy constructor.
XmlOutputterTest( const XmlOutputterTest © );
/// Prevents the use of the copy operator.
void operator =( const XmlOutputterTest © );
std::string statistics( int tests,
int total,
int error,
int failure );
void addTest( std::string testName );
void addTestFailure( std::string testName,
std::string message,
CppUnit::SourceLine sourceLine = CppUnit::SourceLine() );
void addTestError( std::string testName,
std::string message,
CppUnit::SourceLine sourceLine = CppUnit::SourceLine() );
void addGenericTestFailure( std::string testName,
CppUnit::Message message,
CppUnit::SourceLine sourceLine,
bool isError );
CppUnit::Test *makeDummyTest( std::string testName );
private:
CppUnit::TestResultCollector *m_result;
std::deque<CppUnit::Test *> m_dummyTests;
};
#endif // CPPUNITEST_XMLTESTRESULTOUTPUTTERTEST_H
|