From b9bc530ad20bceeed6e43ea459d271046f43e70c Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Sat, 14 Apr 2012 05:44:27 -0400 Subject: Regression: Add ANSI colours to highlight test status This patch adds a very basic pretty-printing of the test status (passed or failed) to highlight failing tests even more: green for passed, and red for failed. The printing only uses ANSI it the target output is a tty and supports ANSI colours. Hence, any regression scripts that are outputting to files or sending e-mails etc should still be fine. --- SConstruct | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index baf95724a..a45a6e63f 100755 --- a/SConstruct +++ b/SConstruct @@ -120,6 +120,7 @@ extra_python_paths = [ sys.path[1:1] = extra_python_paths from m5.util import compareVersions, readCommand +from m5.util.terminal import get_termcap help_texts = { "options" : "", @@ -169,14 +170,7 @@ AddLocalOption('--update-ref', dest='update_ref', action='store_true', AddLocalOption('--verbose', dest='verbose', action='store_true', help='Print full tool command lines') -use_colors = GetOption('use_colors') -if use_colors: - from m5.util.terminal import termcap -elif use_colors is None: - # option unspecified; default behavior is to use colors iff isatty - from m5.util.terminal import tty_termcap as termcap -else: - from m5.util.terminal import no_termcap as termcap +termcap = get_termcap(GetOption('use_colors')) ######################################################################## # @@ -462,6 +456,8 @@ class Transform(object): Export('Transform') +# enable the regression script to use the termcap +main['TERMCAP'] = termcap if GetOption('verbose'): def MakeAction(action, string, *args, **kwargs): -- cgit v1.2.3