File indexing completed on 2025-01-18 09:54:04
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef CATCH_INTERFACES_CONFIG_HPP_INCLUDED
0009 #define CATCH_INTERFACES_CONFIG_HPP_INCLUDED
0010
0011 #include <catch2/internal/catch_noncopyable.hpp>
0012 #include <catch2/internal/catch_stringref.hpp>
0013
0014 #include <chrono>
0015 #include <iosfwd>
0016 #include <string>
0017 #include <vector>
0018
0019 namespace Catch {
0020
0021 enum class Verbosity {
0022 Quiet = 0,
0023 Normal,
0024 High
0025 };
0026
0027 struct WarnAbout { enum What {
0028 Nothing = 0x00,
0029
0030 NoAssertions = 0x01,
0031
0032 UnmatchedTestSpec = 0x02,
0033 }; };
0034
0035 enum class ShowDurations {
0036 DefaultForReporter,
0037 Always,
0038 Never
0039 };
0040 enum class TestRunOrder {
0041 Declared,
0042 LexicographicallySorted,
0043 Randomized
0044 };
0045 enum class ColourMode : std::uint8_t {
0046
0047 PlatformDefault,
0048
0049 ANSI,
0050
0051 Win32,
0052
0053 None
0054 };
0055 struct WaitForKeypress { enum When {
0056 Never,
0057 BeforeStart = 1,
0058 BeforeExit = 2,
0059 BeforeStartAndExit = BeforeStart | BeforeExit
0060 }; };
0061
0062 class TestSpec;
0063 class IStream;
0064
0065 class IConfig : public Detail::NonCopyable {
0066 public:
0067 virtual ~IConfig();
0068
0069 virtual bool allowThrows() const = 0;
0070 virtual StringRef name() const = 0;
0071 virtual bool includeSuccessfulResults() const = 0;
0072 virtual bool shouldDebugBreak() const = 0;
0073 virtual bool warnAboutMissingAssertions() const = 0;
0074 virtual bool warnAboutUnmatchedTestSpecs() const = 0;
0075 virtual bool zeroTestsCountAsSuccess() const = 0;
0076 virtual int abortAfter() const = 0;
0077 virtual bool showInvisibles() const = 0;
0078 virtual ShowDurations showDurations() const = 0;
0079 virtual double minDuration() const = 0;
0080 virtual TestSpec const& testSpec() const = 0;
0081 virtual bool hasTestFilters() const = 0;
0082 virtual std::vector<std::string> const& getTestsOrTags() const = 0;
0083 virtual TestRunOrder runOrder() const = 0;
0084 virtual uint32_t rngSeed() const = 0;
0085 virtual unsigned int shardCount() const = 0;
0086 virtual unsigned int shardIndex() const = 0;
0087 virtual ColourMode defaultColourMode() const = 0;
0088 virtual std::vector<std::string> const& getSectionsToRun() const = 0;
0089 virtual Verbosity verbosity() const = 0;
0090
0091 virtual bool skipBenchmarks() const = 0;
0092 virtual bool benchmarkNoAnalysis() const = 0;
0093 virtual unsigned int benchmarkSamples() const = 0;
0094 virtual double benchmarkConfidenceInterval() const = 0;
0095 virtual unsigned int benchmarkResamples() const = 0;
0096 virtual std::chrono::milliseconds benchmarkWarmupTime() const = 0;
0097 };
0098 }
0099
0100 #endif