2012-02-25 21:36:22 +01:00
|
|
|
/*
|
|
|
|
* Created by Phil on 25/2/2012.
|
|
|
|
* Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
|
|
|
|
*
|
|
|
|
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
*/
|
|
|
|
#ifndef TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED
|
|
|
|
#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED
|
|
|
|
|
|
|
|
#include "catch_common.h"
|
|
|
|
|
2012-05-15 09:02:36 +02:00
|
|
|
namespace Catch {
|
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
struct Colour {
|
|
|
|
enum Code {
|
|
|
|
None = 0,
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
White,
|
|
|
|
Red,
|
|
|
|
Green,
|
|
|
|
Blue,
|
|
|
|
Cyan,
|
|
|
|
Yellow,
|
|
|
|
Grey,
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
Bright = 0x10,
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
BrightRed = Bright | Red,
|
|
|
|
BrightGreen = Bright | Green,
|
|
|
|
LightGrey = Bright | Grey,
|
|
|
|
BrightWhite = Bright | White,
|
2018-01-26 23:04:54 +01:00
|
|
|
BrightYellow = Bright | Yellow,
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
// By intention
|
2013-04-05 08:59:28 +02:00
|
|
|
FileName = LightGrey,
|
2018-01-26 23:04:54 +01:00
|
|
|
Warning = BrightYellow,
|
2013-04-05 08:47:36 +02:00
|
|
|
ResultError = BrightRed,
|
|
|
|
ResultSuccess = BrightGreen,
|
2014-07-03 09:09:57 +02:00
|
|
|
ResultExpectedFailure = Warning,
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
Error = BrightRed,
|
|
|
|
Success = Green,
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
OriginalExpression = Cyan,
|
2018-01-26 23:04:54 +01:00
|
|
|
ReconstructedExpression = BrightYellow,
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:59:28 +02:00
|
|
|
SecondaryText = LightGrey,
|
2013-04-05 08:47:36 +02:00
|
|
|
Headers = White
|
|
|
|
};
|
|
|
|
|
2013-04-05 08:59:28 +02:00
|
|
|
// Use constructed object for RAII guard
|
2013-04-05 08:47:36 +02:00
|
|
|
Colour( Code _colourCode );
|
2017-07-25 17:16:28 +02:00
|
|
|
Colour( Colour&& other ) noexcept;
|
|
|
|
Colour& operator=( Colour&& other ) noexcept;
|
2013-04-05 08:47:36 +02:00
|
|
|
~Colour();
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:59:28 +02:00
|
|
|
// Use static method for one-shot changes
|
2013-04-05 08:47:36 +02:00
|
|
|
static void use( Code _colourCode );
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2013-04-05 08:47:36 +02:00
|
|
|
private:
|
2017-07-20 00:27:28 +02:00
|
|
|
bool m_moved = false;
|
2013-04-05 08:47:36 +02:00
|
|
|
};
|
2013-07-03 20:14:59 +02:00
|
|
|
|
2017-07-10 14:25:38 +02:00
|
|
|
std::ostream& operator << ( std::ostream& os, Colour const& );
|
2014-07-03 09:09:57 +02:00
|
|
|
|
2012-02-25 21:36:22 +01:00
|
|
|
} // end namespace Catch
|
|
|
|
|
|
|
|
#endif // TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED
|