mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
Turn UseColour into enum class
This commit is contained in:
parent
b0531404e4
commit
aa28a917cb
@ -74,7 +74,7 @@ namespace Catch {
|
||||
double Config::minDuration() const { return m_data.minDuration; }
|
||||
TestRunOrder Config::runOrder() const { return m_data.runOrder; }
|
||||
unsigned int Config::rngSeed() const { return m_data.rngSeed; }
|
||||
UseColour::YesOrNo Config::useColour() const { return m_data.useColour; }
|
||||
UseColour Config::useColour() const { return m_data.useColour; }
|
||||
bool Config::shouldDebugBreak() const { return m_data.shouldDebugBreak; }
|
||||
int Config::abortAfter() const { return m_data.abortAfter; }
|
||||
bool Config::showInvisibles() const { return m_data.showInvisibles; }
|
||||
|
@ -46,7 +46,7 @@ namespace Catch {
|
||||
ShowDurations showDurations = ShowDurations::DefaultForReporter;
|
||||
double minDuration = -1;
|
||||
TestRunOrder runOrder = TestRunOrder::Declared;
|
||||
UseColour::YesOrNo useColour = UseColour::Auto;
|
||||
UseColour useColour = UseColour::Auto;
|
||||
WaitForKeypress::When waitForKeypress = WaitForKeypress::Never;
|
||||
|
||||
std::string outputFilename;
|
||||
@ -98,7 +98,7 @@ namespace Catch {
|
||||
double minDuration() const override;
|
||||
TestRunOrder runOrder() const override;
|
||||
unsigned int rngSeed() const override;
|
||||
UseColour::YesOrNo useColour() const override;
|
||||
UseColour useColour() const override;
|
||||
bool shouldDebugBreak() const override;
|
||||
int abortAfter() const override;
|
||||
bool showInvisibles() const override;
|
||||
|
@ -39,11 +39,11 @@ namespace Catch {
|
||||
LexicographicallySorted,
|
||||
Randomized
|
||||
};
|
||||
struct UseColour { enum YesOrNo {
|
||||
enum class UseColour {
|
||||
Auto,
|
||||
Yes,
|
||||
No
|
||||
}; };
|
||||
};
|
||||
struct WaitForKeypress { enum When {
|
||||
Never,
|
||||
BeforeStart = 1,
|
||||
@ -73,7 +73,7 @@ namespace Catch {
|
||||
virtual std::vector<std::string> const& getTestsOrTags() const = 0;
|
||||
virtual TestRunOrder runOrder() const = 0;
|
||||
virtual unsigned int rngSeed() const = 0;
|
||||
virtual UseColour::YesOrNo useColour() const = 0;
|
||||
virtual UseColour useColour() const = 0;
|
||||
virtual std::vector<std::string> const& getSectionsToRun() const = 0;
|
||||
virtual Verbosity verbosity() const = 0;
|
||||
|
||||
|
@ -106,7 +106,7 @@ namespace {
|
||||
static Win32ColourImpl s_instance;
|
||||
|
||||
auto const* config = getCurrentContext().getConfig();
|
||||
UseColour::YesOrNo colourMode = config?
|
||||
UseColour colourMode = config?
|
||||
config->useColour() : UseColour::Auto;
|
||||
if( colourMode == UseColour::Auto )
|
||||
colourMode = UseColour::Yes;
|
||||
@ -179,7 +179,7 @@ namespace {
|
||||
IColourImpl* platformColourInstance() {
|
||||
ErrnoGuard guard;
|
||||
auto const* config = getCurrentContext().getConfig();
|
||||
UseColour::YesOrNo colourMode = config
|
||||
UseColour colourMode = config
|
||||
? config->useColour()
|
||||
: UseColour::Auto;
|
||||
if( colourMode == UseColour::Auto )
|
||||
|
Loading…
Reference in New Issue
Block a user