mirror of
https://github.com/ziglang/zig.git
synced 2024-11-15 00:26:57 +00:00
test_runner: workaround #1923, isolating error traces in tests
Essentially #1923 means "caught" errors still show up in error return traces. The correct fix would require the compiler to fix this, but that could affect performance. For now, simply workaround this issue by clearing the return traces between tests. This means that "caught" errors in one test will not show up in the error traces of other tests.
This commit is contained in:
parent
8667d6d61e
commit
1a32f2a7f4
@ -96,6 +96,13 @@ pub fn main() void {
|
||||
test_node.end();
|
||||
},
|
||||
}
|
||||
// Workaround issue #1923 by clearing error stack traces between tests
|
||||
//
|
||||
// This is not a true fix, but helps isolate errors to the tests where they
|
||||
// originate instead of confusing them all together
|
||||
if (@errorReturnTrace()) |trace| {
|
||||
trace.index = 0;
|
||||
}
|
||||
}
|
||||
root_node.end();
|
||||
if (ok_count == test_fn_list.len) {
|
||||
|
Loading…
Reference in New Issue
Block a user