Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
catch_config.hpp
Go to the documentation of this file.
1/*
2 * Created by Phil on 08/11/2010.
3 * Copyright 2010 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_CONFIG_HPP_INCLUDED
9#define TWOBLUECUBES_CATCH_CONFIG_HPP_INCLUDED
10
13
14// Libstdc++ doesn't like incomplete classes for unique_ptr
15#include "catch_stream.h"
16
17#include <memory>
18#include <vector>
19#include <string>
20
21#ifndef CATCH_CONFIG_CONSOLE_WIDTH
22#define CATCH_CONFIG_CONSOLE_WIDTH 80
23#endif
24
25namespace Catch {
26
27 struct IStream;
28
29 struct ConfigData {
30 bool listTests = false;
31 bool listTags = false;
32 bool listReporters = false;
33 bool listTestNamesOnly = false;
34
35 bool showSuccessfulTests = false;
36 bool shouldDebugBreak = false;
37 bool noThrow = false;
38 bool showHelp = false;
39 bool showInvisibles = false;
40 bool filenamesAsTags = false;
41 bool libIdentify = false;
42
43 int abortAfter = -1;
44 unsigned int rngSeed = 0;
46
53
54 std::string outputFilename;
55 std::string name;
56 std::string processName;
57#ifndef CATCH_CONFIG_DEFAULT_REPORTER
58#define CATCH_CONFIG_DEFAULT_REPORTER "console"
59#endif
61#undef CATCH_CONFIG_DEFAULT_REPORTER
62
63 std::vector<std::string> testsOrTags;
64 std::vector<std::string> sectionsToRun;
65 };
66
67
68 class Config : public IConfig {
69 public:
70
71 Config() = default;
72 Config( ConfigData const& data );
73 virtual ~Config() = default;
74
75 std::string const& getFilename() const;
76
77 bool listTests() const;
78 bool listTestNamesOnly() const;
79 bool listTags() const;
80 bool listReporters() const;
81
82 std::string getProcessName() const;
83 std::string const& getReporterName() const;
84
85 std::vector<std::string> const& getTestsOrTags() const override;
86 std::vector<std::string> const& getSectionsToRun() const override;
87
88 TestSpec const& testSpec() const override;
89 bool hasTestFilters() const override;
90
91 bool showHelp() const;
92
93 // IConfig interface
94 bool allowThrows() const override;
95 std::ostream& stream() const override;
96 std::string name() const override;
97 bool includeSuccessfulResults() const override;
98 bool warnAboutMissingAssertions() const override;
99 bool warnAboutNoTests() const override;
100 ShowDurations::OrNot showDurations() const override;
101 RunTests::InWhatOrder runOrder() const override;
102 unsigned int rngSeed() const override;
103 int benchmarkResolutionMultiple() const override;
104 UseColour::YesOrNo useColour() const override;
105 bool shouldDebugBreak() const override;
106 int abortAfter() const override;
107 bool showInvisibles() const override;
108 Verbosity verbosity() const override;
109
110 private:
111
112 IStream const* openStream();
113 ConfigData m_data;
114
115 std::unique_ptr<IStream const> m_stream;
116 TestSpec m_testSpec;
117 bool m_hasTestFilters = false;
118 };
119
120} // end namespace Catch
121
122#endif // TWOBLUECUBES_CATCH_CONFIG_HPP_INCLUDED
#define CATCH_CONFIG_DEFAULT_REPORTER
std::vector< std::string > const & getTestsOrTags() const override
bool hasTestFilters() const override
std::string name() const override
std::vector< std::string > const & getSectionsToRun() const override
bool listTests() const
unsigned int rngSeed() const override
bool listReporters() const
bool warnAboutMissingAssertions() const override
int benchmarkResolutionMultiple() const override
bool showInvisibles() const override
UseColour::YesOrNo useColour() const override
std::string const & getFilename() const
ShowDurations::OrNot showDurations() const override
bool includeSuccessfulResults() const override
bool listTestNamesOnly() const
bool listTags() const
virtual ~Config()=default
TestSpec const & testSpec() const override
Verbosity verbosity() const override
RunTests::InWhatOrder runOrder() const override
int abortAfter() const override
bool warnAboutNoTests() const override
std::string getProcessName() const
std::ostream & stream() const override
std::string const & getReporterName() const
bool allowThrows() const override
bool shouldDebugBreak() const override
Config()=default
bool showHelp() const
ShowDurations::OrNot showDurations
RunTests::InWhatOrder runOrder
std::string outputFilename
std::vector< std::string > sectionsToRun
std::string reporterName
WaitForKeypress::When waitForKeypress
std::vector< std::string > testsOrTags
UseColour::YesOrNo useColour
std::string processName
unsigned int rngSeed
WarnAbout::What warnings