Add tests for #835

Also add ErrnoGuard before `isatty` call, because apparently it can set
errno to 25 (ENOTTY).
This commit is contained in:
Martin Hořeňovský 2017-03-06 22:07:33 +01:00
parent 613e1466f9
commit ace70407a2
7 changed files with 92 additions and 12 deletions

View file

@ -9,6 +9,7 @@
#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED
#include "catch_console_colour.hpp"
#include "catch_errno_guard.hpp"
namespace Catch {
namespace {
@ -148,6 +149,7 @@ namespace {
};
IColourImpl* platformColourInstance() {
ErrnoGuard guard;
Ptr<IConfig const> config = getCurrentContext().getConfig();
UseColour::YesOrNo colourMode = config
? config->useColour()