blob: f509c7ed8f5d0b2e0c43cbb4866851839917b86f [file] [log] [blame]
Phil Nash46a34762012-06-05 20:50:47 +01001/*
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 Nash8ccbf632017-04-25 21:51:44 +010011#include "catch_common.h"
12
Martin Hořeňovskýbc68b9f2017-02-12 13:34:55 +010013#include <iosfwd>
Phil Nashe1459952013-05-28 18:39:32 +010014#include <string>
Phil Nash20cad7c2014-04-15 18:44:37 +010015#include <vector>
Phil Nash8ccbf632017-04-25 21:51:44 +010016#include <memory>
Phil Nashe1459952013-05-28 18:39:32 +010017
Phil Nash46a34762012-06-05 20:50:47 +010018namespace Catch {
19
Baruch Burstein1e7000e2017-06-20 22:14:38 +030020 enum class Verbosity {
21 Quiet = 0,
22 Normal,
23 High
24 };
Phil Nash63392542013-08-07 18:56:35 +010025
26 struct WarnAbout { enum What {
27 Nothing = 0x00,
dvirtz355b3f92018-02-09 01:31:19 +020028 NoAssertions = 0x01,
29 NoTests = 0x02
Phil Nash63392542013-08-07 18:56:35 +010030 }; };
31
32 struct ShowDurations { enum OrNot {
33 DefaultForReporter,
34 Always,
35 Never
36 }; };
Phil Nashfa0122b2014-09-15 18:39:31 +010037 struct RunTests { enum InWhatOrder {
38 InDeclarationOrder,
39 InLexicographicalOrder,
40 InRandomOrder
41 }; };
Phil Nash8ccb18d2016-02-24 18:51:01 +000042 struct UseColour { enum YesOrNo {
43 Auto,
44 Yes,
45 No
Martin Hořeňovskýc390c4c2017-01-26 23:13:12 +010046 }; };
Phil Nash917a51d2017-08-11 19:55:55 +010047 struct WaitForKeypress { enum When {
48 Never,
49 BeforeStart = 1,
50 BeforeExit = 2,
51 BeforeStartAndExit = BeforeStart | BeforeExit
52 }; };
Phil Nash63392542013-08-07 18:56:35 +010053
Phil Nashae75b372014-05-16 18:24:07 +010054 class TestSpec;
Phil Nash20cad7c2014-04-15 18:44:37 +010055
Phil Nash338ba6b2017-04-25 20:18:02 +010056 struct IConfig : NonCopyable {
Phil Nashf3d1f082013-07-03 19:14:59 +010057
Phil Nasha695eb92012-08-13 07:46:10 +010058 virtual ~IConfig();
Phil Nashf3d1f082013-07-03 19:14:59 +010059
Phil Nash46a34762012-06-05 20:50:47 +010060 virtual bool allowThrows() const = 0;
Phil Nashe1459952013-05-28 18:39:32 +010061 virtual std::ostream& stream() const = 0;
62 virtual std::string name() const = 0;
63 virtual bool includeSuccessfulResults() const = 0;
Phil Nashca9b92f2013-05-28 18:51:53 +010064 virtual bool shouldDebugBreak() const = 0;
Phil Nashe1459952013-05-28 18:39:32 +010065 virtual bool warnAboutMissingAssertions() const = 0;
dvirtz355b3f92018-02-09 01:31:19 +020066 virtual bool warnAboutNoTests() const = 0;
Phil Nashca9b92f2013-05-28 18:51:53 +010067 virtual int abortAfter() const = 0;
Phil Nash7059b2c2014-04-22 18:23:42 +010068 virtual bool showInvisibles() const = 0;
Phil Nash63392542013-08-07 18:56:35 +010069 virtual ShowDurations::OrNot showDurations() const = 0;
Phil Nashae75b372014-05-16 18:24:07 +010070 virtual TestSpec const& testSpec() const = 0;
dvirtzca8470f2018-02-09 00:18:32 +020071 virtual bool hasTestFilters() const = 0;
Phil Nashfa0122b2014-09-15 18:39:31 +010072 virtual RunTests::InWhatOrder runOrder() const = 0;
73 virtual unsigned int rngSeed() const = 0;
Phil Nasheed4ae82017-08-09 22:26:17 +010074 virtual int benchmarkResolutionMultiple() const = 0;
Phil Nash8ccb18d2016-02-24 18:51:01 +000075 virtual UseColour::YesOrNo useColour() const = 0;
Phil Nashe7bcbb32017-01-12 17:10:38 +000076 virtual std::vector<std::string> const& getSectionsToRun() const = 0;
Baruch Bursteinf7493472017-07-06 01:25:49 +030077 virtual Verbosity verbosity() const = 0;
Phil Nash46a34762012-06-05 20:50:47 +010078 };
Phil Nash338ba6b2017-04-25 20:18:02 +010079
80 using IConfigPtr = std::shared_ptr<IConfig const>;
Phil Nash46a34762012-06-05 20:50:47 +010081}
82
83#endif // TWOBLUECUBES_CATCH_INTERFACES_CONFIG_H_INCLUDED