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_TESTCASE_H_INCLUDED
9 #define TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED
10 
11 #include "catch_ptr.hpp"
12 
13 #include <vector>
14 
15 namespace Catch {
16 
17     class TestSpec;
18 
19     struct ITestCase : IShared {
20         virtual void invoke () const = 0;
21     protected:
22         virtual ~ITestCase();
23     };
24 
25     class TestCase;
26     struct IConfig;
27 
28     struct ITestCaseRegistry {
29         virtual ~ITestCaseRegistry();
30         virtual std::vector<TestCase> const& getAllTests() const = 0;
31         virtual std::vector<TestCase> const& getAllTestsSorted( IConfig const& config ) const = 0;
32     };
33 
34     bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config );
35     std::vector<TestCase> filterTests( std::vector<TestCase> const& testCases, TestSpec const& testSpec, IConfig const& config );
36     std::vector<TestCase> const& getAllTestCasesSorted( IConfig const& config );
37 
38 }
39 
40 #endif // TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED
41