?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. #ifndef UNITTEST_THROWINGTESTREPORTER_H
  2. #define UNITTEST_THROWINGTESTREPORTER_H
  3.  
  4. #include "TestReporter.h"
  5.  
  6. namespace UnitTest {
  7.  
  8.    // A TestReporter that throws when ReportFailure is called. Otherwise it
  9.    // forwards the calls to a decorated TestReporter
  10.    class ThrowingTestReporter : public TestReporter
  11.    {
  12.    public:
  13.       explicit ThrowingTestReporter(TestReporter* reporter);
  14.  
  15.       virtual ~ThrowingTestReporter();
  16.       virtual void ReportTestStart(TestDetails const& test);
  17.       virtual void ReportFailure(TestDetails const& test, char const* failure);
  18.       virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed);
  19.       virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed);
  20.  
  21.    private:
  22.       TestReporter* m_decoratedReporter;
  23.    };
  24. }
  25.  
  26. #endif
  27.