authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-10-21 20:49:35-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-10-21 20:50:47-04:00
log65165554d0c6cf39ff091ace5ab5d48106a935fd
treee38868124fe56d634bd18670afaf67501e1f53cb
parent9a82f00a4fb897acf50446a725768c3aaa562513
signature Commit is signed but in an unrecognized format.

test runner: restore previous behavior when...

...stderr does not support ansi escape codes

1 files changed, 4 insertions(+), 0 deletions(-)

lib/std/special/test_runner.zig+4
...@@ -15,14 +15,17 @@ pub fn main() anyerror!void {...@@ -15,14 +15,17 @@ pub fn main() anyerror!void {
15 for (test_fn_list) |test_fn, i| {15 for (test_fn_list) |test_fn, i| {
16 var test_node = root_node.start(test_fn.name, null);16 var test_node = root_node.start(test_fn.name, null);
17 test_node.activate();17 test_node.activate();
18 if (progress.terminal == null) std.debug.warn("{}/{} {}...", i + 1, test_fn_list.len, test_fn.name);
18 if (test_fn.func()) |_| {19 if (test_fn.func()) |_| {
19 ok_count += 1;20 ok_count += 1;
20 test_node.end();21 test_node.end();
22 if (progress.terminal == null) std.debug.warn("OK\n");
21 } else |err| switch (err) {23 } else |err| switch (err) {
22 error.SkipZigTest => {24 error.SkipZigTest => {
23 skip_count += 1;25 skip_count += 1;
24 test_node.end();26 test_node.end();
25 progress.log("{}...SKIP\n", test_fn.name);27 progress.log("{}...SKIP\n", test_fn.name);
28 if (progress.terminal == null) std.debug.warn("SKIP\n");
26 },29 },
27 else => return err,30 else => return err,
28 }31 }
...@@ -30,5 +33,6 @@ pub fn main() anyerror!void {...@@ -30,5 +33,6 @@ pub fn main() anyerror!void {
30 root_node.end();33 root_node.end();
31 if (ok_count != test_fn_list.len) {34 if (ok_count != test_fn_list.len) {
32 progress.log("{} passed; {} skipped.\n", ok_count, skip_count);35 progress.log("{} passed; {} skipped.\n", ok_count, skip_count);
36 if (progress.terminal == null) std.debug.warn("{} passed; {} skipped.\n", ok_count, skip_count);
33 }37 }
34}38}