From 6a4ba22eae0869470657995bac91dfee0d04449e Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 22 Jun 2022 12:45:24 +0300 Subject: [PATCH] tests: flush test headers to ensure stable output with VJOBS>1 --- cmd/tools/modules/testing/common.v | 1 + cmd/tools/vtest-all.v | 2 ++ 2 files changed, 3 insertions(+) diff --git a/cmd/tools/modules/testing/common.v b/cmd/tools/modules/testing/common.v index fe68567fc5..db81b5eb36 100644 --- a/cmd/tools/modules/testing/common.v +++ b/cmd/tools/modules/testing/common.v @@ -561,6 +561,7 @@ pub fn eheader(msg string) { pub fn header(msg string) { println(term.header_left(msg, '-')) + flush_stdout() } pub fn setup_new_vtmp_folder() string { diff --git a/cmd/tools/vtest-all.v b/cmd/tools/vtest-all.v index 56765e1f84..692acd6921 100644 --- a/cmd/tools/vtest-all.v +++ b/cmd/tools/vtest-all.v @@ -26,6 +26,7 @@ fn main() { spent := sw.elapsed().milliseconds() oks := commands.filter(it.ecode == 0) fails := commands.filter(it.ecode != 0) + flush_stdout() println('') println(term.header_left(term_highlight('Summary of `v test-all`:'), '-')) println(term_highlight('Total runtime: $spent ms')) @@ -37,6 +38,7 @@ fn main() { msg := if fcmd.errmsg != '' { fcmd.errmsg } else { fcmd.line } println(term.failed('> Failed:') + ' $msg') } + flush_stdout() if fails.len > 0 { exit(1) }