1 /*
2  *  Created by Phil on 07/01/2011.
3  *  Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
4  *
5  *  Distributed under the Boost Software License, Version 1.0. (See accompanying
6  *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7  */
8 #ifndef TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
9 #define TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
10 
11 #include <string>
12 #include "catch_result_type.h"
13 #include "catch_common.h"
14 
15 namespace Catch {
16 
17     class TestCase;
18     class AssertionResult;
19     struct AssertionInfo;
20     struct SectionInfo;
21     struct SectionEndInfo;
22     struct MessageInfo;
23     class ScopedMessageBuilder;
24     struct Counts;
25 
26     struct IResultCapture {
27 
28         virtual ~IResultCapture();
29 
30         virtual void assertionEnded( AssertionResult const& result ) = 0;
31         virtual bool sectionStarted(    SectionInfo const& sectionInfo,
32                                         Counts& assertions ) = 0;
33         virtual void sectionEnded( SectionEndInfo const& endInfo ) = 0;
34         virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) = 0;
35         virtual void pushScopedMessage( MessageInfo const& message ) = 0;
36         virtual void popScopedMessage( MessageInfo const& message ) = 0;
37 
38         virtual std::string getCurrentTestName() const = 0;
39         virtual const AssertionResult* getLastResult() const = 0;
40 
41         virtual void exceptionEarlyReported() = 0;
42 
43         virtual void handleFatalErrorCondition( std::string const& message ) = 0;
44 
45         virtual bool lastAssertionPassed() = 0;
46         virtual void assertionPassed() = 0;
47         virtual void assertionRun() = 0;
48     };
49 
50     IResultCapture& getResultCapture();
51 }
52 
53 #endif // TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
54