nitunit: do not show the status bar if no-color or verbose
authorJean Privat <jean@pryen.org>
Thu, 2 Jun 2016 21:29:33 +0000 (17:29 -0400)
committerJean Privat <jean@pryen.org>
Thu, 2 Jun 2016 21:58:34 +0000 (17:58 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/testing/testing_base.nit

index ddc167f..c24fc71 100644 (file)
@@ -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`.