3 // $Id: cpptest-collectoroutput.h,v 1.3 2005/06/08 08:08:06 nilu Exp $
5 // CppTest - A C++ Unit Testing Framework
6 // Copyright (c) 2003 Niklas Lundell
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2 of the License, or (at your option) any later version.
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the
22 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 // Boston, MA 02111-1307, USA.
29 #ifndef CPPTEST_COLLECTOROUTPUT_H
30 #define CPPTEST_COLLECTOROUTPUT_H
36 #include "cpptest-output.h"
37 #include "cpptest-source.h"
38 #include "cpptest-time.h"
42 /// \brief Collector output.
44 /// Base class for output handlers that need to report status when all
45 /// tests have executed.
47 class CollectorOutput
: public Output
50 virtual void finished(int tests
, const Time
& time
);
51 virtual void suite_start(int tests
, const std::string
& name
);
52 virtual void suite_end(int tests
, const std::string
& name
,
54 virtual void test_start(const std::string
& name
);
55 virtual void test_end(const std::string
& name
, bool ok
,
57 virtual void assertment(const Source
& s
);
60 struct OutputSuiteInfo
;
61 struct OutputTestInfo
;
62 struct OutputErrorTestInfo
;
64 typedef std::list
<Source
> Sources
;
74 explicit TestInfo(const std::string name
);
77 typedef std::vector
<TestInfo
> Tests
;
86 SuiteInfo(const std::string
& name
, int tests
);
89 typedef std::list
<SuiteInfo
> Suites
;
99 SuiteInfo
* _cur_suite
;
105 #endif // #ifndef CPPTEST_COLLECTOROUTPUT_H