From f77ce359cec2cc50c5a98e4b4257e63ed702995e Mon Sep 17 00:00:00 2001 From: Feoramund <161657516+Feoramund@users.noreply.github.com> Date: Sun, 2 Jun 2024 15:40:09 -0400 Subject: [PATCH] Be pedantic about not overwriting Odin errors I was encountering bounds-check error messages being overwritten during a test, if the test failed for another reason and sent a log message. The original intent of having this check inside of the above `if` block was that if a test sent an error message, then it was assumed an overwrite would be safe, but it's completely possible for a test to fail for a legitimate reason, then do an unrelated bounds check somewhere else that would be buried under the animation. This change will make sure that, no matter what, the progress display will not trigger a clear if a signal was raised. There's still no guarantee that bounds-check messages will be printed properly, and it's best to redirect STDERR. The only way that can be fixed is if they get a similar hook to `context.assertion_failure_proc`. --- core/testing/runner.odin | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/testing/runner.odin b/core/testing/runner.odin index 5b80d0cf8..190e10744 100644 --- a/core/testing/runner.odin +++ b/core/testing/runner.odin @@ -648,10 +648,11 @@ runner :: proc(internal_tests: []Internal_Test) -> bool { failed_test_reason_map[test_index] = fmt.aprintf("Signal caught: %v", reason, allocator = shared_log_allocator) pkg_log.fatalf("Caught signal to stop test #%i %s.%s for: %v.", test_index, it.pkg, it.name, reason) - when FANCY_OUTPUT { - signals_were_raised = true - bypass_progress_overwrite = true - } + } + + when FANCY_OUTPUT { + bypass_progress_overwrite = true + signals_were_raised = true } total_failure_count += 1