Переглянути джерело

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`.
Feoramund 1 рік тому
батько
коміт
f77ce359ce
1 змінених файлів з 5 додано та 4 видалено
  1. 5 4
      core/testing/runner.odin

+ 5 - 4
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