Phil Nash | 46a3476 | 2012-06-05 20:50:47 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Created by Phil on 05/06/2012. |
| 3 | * Copyright 2012 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_CONFIG_H_INCLUDED |
| 9 | #define TWOBLUECUBES_CATCH_INTERFACES_CONFIG_H_INCLUDED |
| 10 | |
Phil Nash | 8ccbf63 | 2017-04-25 21:51:44 +0100 | [diff] [blame] | 11 | #include "catch_common.h" |
| 12 | |
Martin Hořeňovský | bc68b9f | 2017-02-12 13:34:55 +0100 | [diff] [blame] | 13 | #include <iosfwd> |
Phil Nash | e145995 | 2013-05-28 18:39:32 +0100 | [diff] [blame] | 14 | #include <string> |
Phil Nash | 20cad7c | 2014-04-15 18:44:37 +0100 | [diff] [blame] | 15 | #include <vector> |
Phil Nash | 8ccbf63 | 2017-04-25 21:51:44 +0100 | [diff] [blame] | 16 | #include <memory> |
Phil Nash | e145995 | 2013-05-28 18:39:32 +0100 | [diff] [blame] | 17 | |
Phil Nash | 46a3476 | 2012-06-05 20:50:47 +0100 | [diff] [blame] | 18 | namespace Catch { |
| 19 | |
Baruch Burstein | 1e7000e | 2017-06-20 22:14:38 +0300 | [diff] [blame] | 20 | enum class Verbosity { |
| 21 | Quiet = 0, |
| 22 | Normal, |
| 23 | High |
| 24 | }; |
Phil Nash | 6339254 | 2013-08-07 18:56:35 +0100 | [diff] [blame] | 25 | |
| 26 | struct WarnAbout { enum What { |
| 27 | Nothing = 0x00, |
dvirtz | 355b3f9 | 2018-02-09 01:31:19 +0200 | [diff] [blame] | 28 | NoAssertions = 0x01, |
| 29 | NoTests = 0x02 |
Phil Nash | 6339254 | 2013-08-07 18:56:35 +0100 | [diff] [blame] | 30 | }; }; |
| 31 | |
| 32 | struct ShowDurations { enum OrNot { |
| 33 | DefaultForReporter, |
| 34 | Always, |
| 35 | Never |
| 36 | }; }; |
Phil Nash | fa0122b | 2014-09-15 18:39:31 +0100 | [diff] [blame] | 37 | struct RunTests { enum InWhatOrder { |
| 38 | InDeclarationOrder, |
| 39 | InLexicographicalOrder, |
| 40 | InRandomOrder |
| 41 | }; }; |
Phil Nash | 8ccb18d | 2016-02-24 18:51:01 +0000 | [diff] [blame] | 42 | struct UseColour { enum YesOrNo { |
| 43 | Auto, |
| 44 | Yes, |
| 45 | No |
Martin Hořeňovský | c390c4c | 2017-01-26 23:13:12 +0100 | [diff] [blame] | 46 | }; }; |
Phil Nash | 917a51d | 2017-08-11 19:55:55 +0100 | [diff] [blame] | 47 | struct WaitForKeypress { enum When { |
| 48 | Never, |
| 49 | BeforeStart = 1, |
| 50 | BeforeExit = 2, |
| 51 | BeforeStartAndExit = BeforeStart | BeforeExit |
| 52 | }; }; |
Phil Nash | 6339254 | 2013-08-07 18:56:35 +0100 | [diff] [blame] | 53 | |
Phil Nash | ae75b37 | 2014-05-16 18:24:07 +0100 | [diff] [blame] | 54 | class TestSpec; |
Phil Nash | 20cad7c | 2014-04-15 18:44:37 +0100 | [diff] [blame] | 55 | |
Phil Nash | 338ba6b | 2017-04-25 20:18:02 +0100 | [diff] [blame] | 56 | struct IConfig : NonCopyable { |
Phil Nash | f3d1f08 | 2013-07-03 19:14:59 +0100 | [diff] [blame] | 57 | |
Phil Nash | a695eb9 | 2012-08-13 07:46:10 +0100 | [diff] [blame] | 58 | virtual ~IConfig(); |
Phil Nash | f3d1f08 | 2013-07-03 19:14:59 +0100 | [diff] [blame] | 59 | |
Phil Nash | 46a3476 | 2012-06-05 20:50:47 +0100 | [diff] [blame] | 60 | virtual bool allowThrows() const = 0; |
Phil Nash | e145995 | 2013-05-28 18:39:32 +0100 | [diff] [blame] | 61 | virtual std::ostream& stream() const = 0; |
| 62 | virtual std::string name() const = 0; |
| 63 | virtual bool includeSuccessfulResults() const = 0; |
Phil Nash | ca9b92f | 2013-05-28 18:51:53 +0100 | [diff] [blame] | 64 | virtual bool shouldDebugBreak() const = 0; |
Phil Nash | e145995 | 2013-05-28 18:39:32 +0100 | [diff] [blame] | 65 | virtual bool warnAboutMissingAssertions() const = 0; |
dvirtz | 355b3f9 | 2018-02-09 01:31:19 +0200 | [diff] [blame] | 66 | virtual bool warnAboutNoTests() const = 0; |
Phil Nash | ca9b92f | 2013-05-28 18:51:53 +0100 | [diff] [blame] | 67 | virtual int abortAfter() const = 0; |
Phil Nash | 7059b2c | 2014-04-22 18:23:42 +0100 | [diff] [blame] | 68 | virtual bool showInvisibles() const = 0; |
Phil Nash | 6339254 | 2013-08-07 18:56:35 +0100 | [diff] [blame] | 69 | virtual ShowDurations::OrNot showDurations() const = 0; |
Phil Nash | ae75b37 | 2014-05-16 18:24:07 +0100 | [diff] [blame] | 70 | virtual TestSpec const& testSpec() const = 0; |
dvirtz | ca8470f | 2018-02-09 00:18:32 +0200 | [diff] [blame] | 71 | virtual bool hasTestFilters() const = 0; |
Phil Nash | fa0122b | 2014-09-15 18:39:31 +0100 | [diff] [blame] | 72 | virtual RunTests::InWhatOrder runOrder() const = 0; |
| 73 | virtual unsigned int rngSeed() const = 0; |
Phil Nash | eed4ae8 | 2017-08-09 22:26:17 +0100 | [diff] [blame] | 74 | virtual int benchmarkResolutionMultiple() const = 0; |
Phil Nash | 8ccb18d | 2016-02-24 18:51:01 +0000 | [diff] [blame] | 75 | virtual UseColour::YesOrNo useColour() const = 0; |
Phil Nash | e7bcbb3 | 2017-01-12 17:10:38 +0000 | [diff] [blame] | 76 | virtual std::vector<std::string> const& getSectionsToRun() const = 0; |
Baruch Burstein | f749347 | 2017-07-06 01:25:49 +0300 | [diff] [blame] | 77 | virtual Verbosity verbosity() const = 0; |
Phil Nash | 46a3476 | 2012-06-05 20:50:47 +0100 | [diff] [blame] | 78 | }; |
Phil Nash | 338ba6b | 2017-04-25 20:18:02 +0100 | [diff] [blame] | 79 | |
| 80 | using IConfigPtr = std::shared_ptr<IConfig const>; |
Phil Nash | 46a3476 | 2012-06-05 20:50:47 +0100 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | #endif // TWOBLUECUBES_CATCH_INTERFACES_CONFIG_H_INCLUDED |