adjust test runner to print the test name when error occurs

master
Andrew Kelley 2019-10-21 18:35:14 -04:00
parent ddb87237de
commit 16a91e6a45
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
2 changed files with 7 additions and 4 deletions

View File

@ -155,11 +155,11 @@ pub const Progress = struct {
} }
if (node.estimated_total_items) |total| { if (node.estimated_total_items) |total| {
if (need_ellipse) self.bufWrite(&end, " "); if (need_ellipse) self.bufWrite(&end, " ");
self.bufWrite(&end, "[{}/{}] ", node.completed_items, total); self.bufWrite(&end, "[{}/{}] ", node.completed_items + 1, total);
need_ellipse = false; need_ellipse = false;
} else if (node.completed_items != 0) { } else if (node.completed_items != 0) {
if (need_ellipse) self.bufWrite(&end, " "); if (need_ellipse) self.bufWrite(&end, " ");
self.bufWrite(&end, "[{}] ", node.completed_items); self.bufWrite(&end, "[{}] ", node.completed_items + 1);
need_ellipse = false; need_ellipse = false;
} }
} }

View File

@ -24,11 +24,14 @@ pub fn main() anyerror!void {
test_node.end(); test_node.end();
progress.log("{}...SKIP\n", test_fn.name); progress.log("{}...SKIP\n", test_fn.name);
}, },
else => return err, else => {
progress.log("");
return err;
},
} }
} }
root_node.end(); root_node.end();
if (ok_count != test_fn_list.len) { if (ok_count != test_fn_list.len) {
progress.log("{} passed; {} skipped.\n", ok_count, skip_count); std.debug.warn("{} passed; {} skipped.\n", ok_count, skip_count);
} }
} }