mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
Use defer/panic to better account for test failure
This commit is contained in:
parent
0c137934cb
commit
70ad84c820
@ -14,6 +14,11 @@ pub fn main() anyerror!void {
|
||||
|
||||
for (test_fn_list) |test_fn, i| {
|
||||
std.testing.allocator_instance.reset();
|
||||
defer {
|
||||
std.testing.leak_count_allocator_instance.validate() catch |err| {
|
||||
@panic(@errorName(err));
|
||||
};
|
||||
}
|
||||
|
||||
var test_node = root_node.start(test_fn.name, null);
|
||||
test_node.activate();
|
||||
@ -37,8 +42,6 @@ pub fn main() anyerror!void {
|
||||
return err;
|
||||
},
|
||||
}
|
||||
|
||||
try std.testing.leak_count_allocator_instance.validate();
|
||||
}
|
||||
root_node.end();
|
||||
if (ok_count == test_fn_list.len) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user