Skip to content

Commit 27a90e1

Browse files
committed
tools: print total time at the *end* of the v test-all output to ease visual comparisons in separate shells, without scrolling
1 parent 2e6b7ef commit 27a90e1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cmd/tools/vtest-all.v

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const l2w_crosscc = os.find_abs_path_of_executable('x86_64-w64-mingw32-gcc-win32
2727
const clang_path = os.find_abs_path_of_executable('clang') or { '' }
2828

2929
fn main() {
30+
unbuffer_stdout()
3031
mut commands := get_all_commands()
3132
// summary
3233
sw := time.new_stopwatch()
@@ -36,10 +37,8 @@ fn main() {
3637
spent := sw.elapsed().milliseconds()
3738
oks := commands.filter(it.ecode == 0)
3839
fails := commands.filter(it.ecode != 0)
39-
flush_stdout()
4040
println('')
4141
println(term.header_left(term_highlight('Summary of `v test-all`:'), '-'))
42-
println(term_highlight('Total runtime: ${spent} ms'))
4342
for ocmd in oks {
4443
msg := if ocmd.okmsg != '' { ocmd.okmsg } else { ocmd.line }
4544
println(term.colorize(term.green, '> OK: ${msg} '))
@@ -48,7 +47,7 @@ fn main() {
4847
msg := if fcmd.errmsg != '' { fcmd.errmsg } else { fcmd.line }
4948
println(term.failed('> Failed:') + ' ${msg}')
5049
}
51-
flush_stdout()
50+
println(term_highlight('Total runtime: ${spent} ms'))
5251
if fails.len > 0 {
5352
exit(1)
5453
}

0 commit comments

Comments
 (0)