Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00029 #ifndef CPPTEST_TEXTOUTPUT_H
00030 #define CPPTEST_TEXTOUTPUT_H
00031
00032 #include <iostream>
00033 #include <list>
00034
00035 #include "cpptest-source.h"
00036 #include "cpptest-output.h"
00037
00038 namespace Test
00039 {
00046 class TextOutput : public Output
00047 {
00048 public:
00051 enum Mode
00052 {
00055 Terse,
00056
00060 Verbose
00061 };
00062
00063 TextOutput(Mode mode, std::ostream& stream = std::cout);
00064
00065 virtual void finished(int tests, const Time& time);
00066 virtual void suite_start(int tests, const std::string& name);
00067 virtual void suite_end(int tests, const std::string& name,
00068 const Time& time);
00069 virtual void test_end(const std::string& name, bool ok,
00070 const Time& time);
00071 virtual void assertment(const Source& s);
00072
00073 private:
00074 typedef std::list<Source> ErrorList;
00075
00076 Mode _mode;
00077 std::ostream& _stream;
00078 ErrorList _suite_error_list;
00079 std::string _suite_name;
00080 int _suite_errors;
00081 int _suite_tests;
00082 int _suite_total_tests;
00083 int _total_errors;
00084 };
00085
00086 }
00087
00088 #endif // #ifndef CPPTEST_TEXTOUTPUT_H