Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include/internal/catch_console_colour.cpp
diff options
context:
space:
mode:
authorPhil Nash2017-09-19 15:25:33 +0100
committerPhil Nash2017-09-19 15:25:33 +0100
commit54f1ce2af287c85e88eff6813d3bc107a8e0c576 (patch)
tree30a7d1690b4de591a3fb0d895e029424ace942e0 /include/internal/catch_console_colour.cpp
parent0a146e3af7dfa8dd3be2b0e7a9804818076895da (diff)
downloadcatch3-54f1ce2af287c85e88eff6813d3bc107a8e0c576.tar.gz
Don't use console colour if running in XCode
Diffstat (limited to 'include/internal/catch_console_colour.cpp')
-rw-r--r--include/internal/catch_console_colour.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/internal/catch_console_colour.cpp b/include/internal/catch_console_colour.cpp
index 13290544..946e2903 100644
--- a/include/internal/catch_console_colour.cpp
+++ b/include/internal/catch_console_colour.cpp
@@ -20,6 +20,7 @@
#include "catch_stream.h"
#include "catch_context.h"
#include "catch_platform.h"
+#include "catch_debugger.h"
namespace Catch {
namespace {
@@ -156,6 +157,13 @@ namespace {
}
};
+ bool useColourOnPlatform() {
+ return
+#ifdef CATCH_PLATFORM_MAC
+ !isDebuggerActive() &&
+#endif
+ isatty(STDOUT_FILENO);
+ }
IColourImpl* platformColourInstance() {
ErrnoGuard guard;
IConfigPtr config = getCurrentContext().getConfig();
@@ -163,7 +171,7 @@ namespace {
? config->useColour()
: UseColour::Auto;
if( colourMode == UseColour::Auto )
- colourMode = isatty(STDOUT_FILENO)
+ colourMode = useColourOnPlatform()
? UseColour::Yes
: UseColour::No;
return colourMode == UseColour::Yes