From 77f0f879f8a9371e50fb1c5b2b5f7252b839883c Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Mon, 20 Nov 2017 18:32:35 +0000 Subject: 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 Reviewed-by: Georgios Pinitas --- tests/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/main.cpp') diff --git a/tests/main.cpp b/tests/main.cpp index 00bfda1b37..73c87b5459 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -182,7 +182,10 @@ int main(int argc, char **argv) break; case framework::LogFormat::PRETTY: default: - printer = support::cpp14::make_unique(); + auto pretty_printer = support::cpp14::make_unique(); + // 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; } -- cgit v1.2.1