test runner: restore previous behavior when...

...stderr does not support ansi escape codes
master
Andrew Kelley 2019-10-21 20:49:35 -04:00
parent 9a82f00a4f
commit 65165554d0
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 4 additions and 0 deletions

View File

@ -15,14 +15,17 @@ pub fn main() anyerror!void {
for (test_fn_list) |test_fn, i| {
var test_node = root_node.start(test_fn.name, null);
test_node.activate();
if (progress.terminal == null) std.debug.warn("{}/{} {}...", i + 1, test_fn_list.len, test_fn.name);
if (test_fn.func()) |_| {
ok_count += 1;
test_node.end();
if (progress.terminal == null) std.debug.warn("OK\n");
} else |err| switch (err) {
error.SkipZigTest => {
skip_count += 1;
test_node.end();
progress.log("{}...SKIP\n", test_fn.name);
if (progress.terminal == null) std.debug.warn("SKIP\n");
},
else => return err,
}
@ -30,5 +33,6 @@ pub fn main() anyerror!void {
root_node.end();
if (ok_count != test_fn_list.len) {
progress.log("{} passed; {} skipped.\n", ok_count, skip_count);
if (progress.terminal == null) std.debug.warn("{} passed; {} skipped.\n", ok_count, skip_count);
}
}