From: Jean Privat Date: Thu, 2 Jun 2016 21:29:33 +0000 (-0400) Subject: nitunit: do not show the status bar if no-color or verbose X-Git-Url: http://nitlanguage.org nitunit: do not show the status bar if no-color or verbose Signed-off-by: Jean Privat --- 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`.