It is accomplished ...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
#ifndef CPPUNIT_TESTRESULTCOLLECTOR_H
|
||||
#define CPPUNIT_TESTRESULTCOLLECTOR_H
|
||||
|
||||
#include <cppunit/Portability.h>
|
||||
|
||||
#if CPPUNIT_NEED_DLL_DECL
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
|
||||
#endif
|
||||
|
||||
#include <cppunit/TestSucessListener.h>
|
||||
#include <deque>
|
||||
|
||||
|
||||
namespace CppUnit
|
||||
{
|
||||
|
||||
|
||||
#if CPPUNIT_NEED_DLL_DECL
|
||||
template class CPPUNIT_API std::deque<TestFailure *>;
|
||||
template class CPPUNIT_API std::deque<Test *>;
|
||||
#endif
|
||||
|
||||
|
||||
/*! \brief Collects test result.
|
||||
* \ingroup WritingTestResult
|
||||
* \ingroup BrowsingCollectedTestResult
|
||||
*
|
||||
* A TestResultCollector is a TestListener which collects the results of executing
|
||||
* a test case. It is an instance of the Collecting Parameter pattern.
|
||||
*
|
||||
* The test framework distinguishes between failures and errors.
|
||||
* A failure is anticipated and checked for with assertions. Errors are
|
||||
* unanticipated problems signified by exceptions that are not generated
|
||||
* by the framework.
|
||||
* \see TestListener, TestFailure.
|
||||
*/
|
||||
class CPPUNIT_API TestResultCollector : public TestSucessListener
|
||||
{
|
||||
public:
|
||||
typedef std::deque<TestFailure *> TestFailures;
|
||||
typedef std::deque<Test *> Tests;
|
||||
|
||||
|
||||
/*! Constructs a TestResultCollector object.
|
||||
*/
|
||||
TestResultCollector( SynchronizationObject *syncObject = 0 );
|
||||
|
||||
/// Destructor.
|
||||
virtual ~TestResultCollector();
|
||||
|
||||
void startTest( Test *test );
|
||||
void addFailure( const TestFailure &failure );
|
||||
|
||||
virtual void reset();
|
||||
|
||||
virtual int runTests() const;
|
||||
virtual int testErrors() const;
|
||||
virtual int testFailures() const;
|
||||
virtual int testFailuresTotal() const;
|
||||
|
||||
virtual const TestFailures& failures() const;
|
||||
virtual const Tests &tests() const;
|
||||
|
||||
protected:
|
||||
Tests m_tests;
|
||||
TestFailures m_failures;
|
||||
int m_testErrors;
|
||||
|
||||
private:
|
||||
/// Prevents the use of the copy constructor.
|
||||
TestResultCollector( const TestResultCollector © );
|
||||
|
||||
/// Prevents the use of the copy operator.
|
||||
void operator =( const TestResultCollector © );
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace CppUnit
|
||||
|
||||
|
||||
#if CPPUNIT_NEED_DLL_DECL
|
||||
#pragma warning( pop )
|
||||
#endif
|
||||
|
||||
|
||||
#endif // CPPUNIT_TESTRESULTCOLLECTOR_H
|
||||
Reference in New Issue
Block a user