tests: use term.header_left, and a more compact output layout
parent
00b3092a92
commit
dd0a97541c
|
@ -441,11 +441,11 @@ pub fn building_any_v_binaries_failed() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn eheader(msg string) {
|
pub fn eheader(msg string) {
|
||||||
eprintln(term.header(msg, '-'))
|
eprintln(term.header_left(msg, '-'))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn header(msg string) {
|
pub fn header(msg string) {
|
||||||
println(term.header(msg, '-'))
|
println(term.header_left(msg, '-'))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn setup_new_vtmp_folder() string {
|
pub fn setup_new_vtmp_folder() string {
|
||||||
|
|
|
@ -22,9 +22,8 @@ fn main() {
|
||||||
oks := commands.filter(it.ecode == 0)
|
oks := commands.filter(it.ecode == 0)
|
||||||
fails := commands.filter(it.ecode != 0)
|
fails := commands.filter(it.ecode != 0)
|
||||||
println('')
|
println('')
|
||||||
println(term.header(term.colorize(term.yellow, term.colorize(term.bold, 'Summary of `v test-all`:')),
|
println(term.header_left(term_highlight('Summary of `v test-all`:'), '-'))
|
||||||
'-'))
|
println(term_highlight('Total runtime: $spent ms'))
|
||||||
println(term.colorize(term.yellow, 'Total runtime: $spent ms'))
|
|
||||||
for ocmd in oks {
|
for ocmd in oks {
|
||||||
msg := if ocmd.okmsg != '' { ocmd.okmsg } else { ocmd.line }
|
msg := if ocmd.okmsg != '' { ocmd.okmsg } else { ocmd.line }
|
||||||
println(term.colorize(term.green, '> OK: $msg '))
|
println(term.colorize(term.green, '> OK: $msg '))
|
||||||
|
@ -124,11 +123,14 @@ fn (mut cmd Command) run() {
|
||||||
// vlib/v/tests/local_test.v and vlib/v/tests/repl/repl_test.v
|
// vlib/v/tests/local_test.v and vlib/v/tests/repl/repl_test.v
|
||||||
os.chdir(vroot)
|
os.chdir(vroot)
|
||||||
if cmd.label != '' {
|
if cmd.label != '' {
|
||||||
println(term.header(cmd.label, '*'))
|
println(term.header_left(cmd.label, '*'))
|
||||||
}
|
}
|
||||||
sw := time.new_stopwatch({})
|
sw := time.new_stopwatch({})
|
||||||
cmd.ecode = os.system(cmd.line)
|
cmd.ecode = os.system(cmd.line)
|
||||||
spent := sw.elapsed().milliseconds()
|
spent := sw.elapsed().milliseconds()
|
||||||
println(term.colorize(term.yellow, '> Running: "$cmd.line" took: $spent ms.'))
|
println(term_highlight('> Running: "$cmd.line" took: $spent ms.'))
|
||||||
println('')
|
}
|
||||||
|
|
||||||
|
fn term_highlight(s string) string {
|
||||||
|
return term.colorize(term.yellow, term.colorize(term.bold, s))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue