From b0476bde8aa85628edc8f17e47f306c5a004e202 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Thu, 2 Jun 2016 17:29:33 -0400 Subject: [PATCH] nitunit: do not show the status bar if no-color or verbose Signed-off-by: Jean Privat --- src/testing/testing_base.nit | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/testing/testing_base.nit b/src/testing/testing_base.nit index ddc167f..c24fc71 100644 --- a/src/testing/testing_base.nit +++ b/src/testing/testing_base.nit @@ -117,7 +117,7 @@ ulimit -t {{{ulimit_usertime}}} 2> /dev/null end end - if opt_no_color.value then + if not has_status then if done == 0 then print "* {name} ({tests.length} tests)" end @@ -131,6 +131,14 @@ ulimit -t {{{ulimit_usertime}}} 2> /dev/null printn "{line}" end + # Is a status bar printed? + # + # true if color and non-verbose mode + fun has_status: Bool + do + return not opt_no_color.value and opt_verbose.value <= 0 + end + # Shoe the full description of the test-case. # # The output honors `--no-color`. -- 1.7.9.5