COMPMID-621: Disable colours when printing to file

Change-Id: I9b49a505201bfd6e0c4a40ad64ce302cbc3f2cf3
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/109907
Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
diff --git a/tests/main.cpp b/tests/main.cpp
index 00bfda1..73c87b5 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -182,7 +182,10 @@
                 break;
             case framework::LogFormat::PRETTY:
             default:
-                printer = support::cpp14::make_unique<framework::PrettyPrinter>();
+                auto pretty_printer = support::cpp14::make_unique<framework::PrettyPrinter>();
+                // Don't use colours if we print to a file:
+                pretty_printer->set_color_output((!log_file->is_set()) && color_output->value());
+                printer = std::move(pretty_printer);
                 break;
         }