1//
2// TextTestResult.h
3//
4
5
6#ifndef Poco_CppUnit_TextTestResult_INCLUDED
7#define Poco_CppUnit_TextTestResult_INCLUDED
8
9
10#include "Poco/CppUnit/CppUnit.h"
11#include "Poco/CppUnit/TestResult.h"
12#include <set>
13#include <ostream>
14
15
16namespace CppUnit {
17
18
19class CppUnit_API TextTestResult: public TestResult
20{
21public:
22 TextTestResult();
23 TextTestResult(std::ostream& ostr);
24
25 virtual void addError(Test* test, CppUnitException* e);
26 virtual void addFailure(Test* test, CppUnitException* e);
27 virtual void startTest(Test* test);
28 virtual void print(std::ostream& stream);
29 virtual void printErrors(std::ostream& stream);
30 virtual void printFailures(std::ostream& stream);
31 virtual void printHeader(std::ostream& stream);
32
33protected:
34 std::string shortName(const std::string& testName);
35 void setup();
36
37private:
38 std::ostream& _ostr;
39 std::set<std::string> _ignored;
40};
41
42
43/* insertion operator for easy output */
44inline std::ostream& operator<< (std::ostream& stream, TextTestResult& result)
45{
46 result.print(stream);
47 return stream;
48}
49
50
51} // namespace CppUnit
52
53
54#endif // Poco_CppUnit_TextTestResult_INCLUDED
55