summaryrefslogtreecommitdiff
path: root/mysql-test/lib
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2019-06-23 19:07:20 +0300
committerEugene Kosov <claprix@yandex.ru>2019-06-23 20:33:13 +0300
commitddeeb42e0b1adc2158fa0baec70d84a0ae3e5828 (patch)
tree148912bb6b066faa1b3e56e2887a57cbe11b875c /mysql-test/lib
parent75833ef9c51e3a2cc57fea048e55ed5670df7b0d (diff)
parentcf40393471b10ca68cc1d2804c22ab9203900978 (diff)
downloadmariadb-git-ddeeb42e0b1adc2158fa0baec70d84a0ae3e5828.tar.gz
Merge 10.1 into 10.2
Diffstat (limited to 'mysql-test/lib')
-rw-r--r--mysql-test/lib/mtr_report.pm26
1 files changed, 25 insertions, 1 deletions
diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm
index 8e040358e58..3701ad79b15 100644
--- a/mysql-test/lib/mtr_report.pm
+++ b/mysql-test/lib/mtr_report.pm
@@ -36,6 +36,21 @@ use POSIX qw[ _exit ];
use IO::Handle qw[ flush ];
use mtr_results;
+use Term::ANSIColor;
+
+my %color_map = qw/pass green
+ retry-pass green
+ fail red
+ retry-fail red
+ disabled bright_black
+ skipped yellow
+ reset reset/;
+sub xterm_color {
+ if (-t STDOUT and defined $ENV{TERM} and $ENV{TERM} =~ /xterm/) {
+ syswrite STDOUT, color($color_map{$_[0]});
+ }
+}
+
my $tot_real_time= 0;
our $timestamp= 0;
@@ -498,7 +513,16 @@ sub mtr_print (@) {
sub mtr_report (@) {
if (defined $verbose)
{
- print _name(). join(" ", @_). "\n";
+ my @s = split /\[ (\S+) \]/, _name() . "@_\n";
+ if (@s > 1) {
+ print $s[0];
+ xterm_color($s[1]);
+ print "[ $s[1] ]";
+ xterm_color('reset');
+ print $s[2];
+ } else {
+ print $s[0];
+ }
}
}