From 65165554d0c6cf39ff091ace5ab5d48106a935fd Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 21 Oct 2019 20:49:35 -0400 Subject: [PATCH] test runner: restore previous behavior when... ...stderr does not support ansi escape codes --- lib/std/special/test_runner.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/std/special/test_runner.zig b/lib/std/special/test_runner.zig index 8fb1b5842d..78db63e4d6 100644 --- a/lib/std/special/test_runner.zig +++ b/lib/std/special/test_runner.zig @@ -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); } }