summaryrefslogtreecommitdiffstats
blob: 60c5ff500459c761a4c889670c2d544cad42f3b1 (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
#ifndef CPPUNIT_TESTSUCCESSLISTENER_H
#define CPPUNIT_TESTSUCCESSLISTENER_H

#include <cppunit/SynchronizedObject.h>
#include <cppunit/TestListener.h>


CPPUNIT_NS_BEGIN


/*! \brief TestListener that checks if any test case failed.
 * \ingroup TrackingTestExecution
 */
class CPPUNIT_API TestSuccessListener : public TestListener,
                                        public SynchronizedObject
{
public:
  /*! Constructs a TestSuccessListener object.
   */
  TestSuccessListener( SynchronizationObject *syncObject = 0 );

  /// Destructor.
  virtual ~TestSuccessListener();

  virtual void reset();

  void addFailure( const TestFailure &failure );

  /// Returns whether the entire test was successful or not.
  virtual bool wasSuccessful() const;

private:
  bool m_success;
};


CPPUNIT_NS_END

#endif  // CPPUNIT_TESTSUCCESSLISTENER_H