diff options
| author | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-05-29 15:36:22 -0400 |
|---|---|---|
| committer | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-06-02 14:47:07 -0400 |
| commit | a1c5bebac72d14711c317e393d337143df17ca87 (patch) | |
| tree | e72f07cec3a23994c32301d93f53470fbcd4483a | |
| parent | 89d8df28bec7b5aebaac1e38ef642754ef57e1f1 (diff) | |
Fix ANSI redraw eating last log line
| -rw-r--r-- | core/testing/reporting.odin | 6 | ||||
| -rw-r--r-- | core/testing/runner.odin | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/core/testing/reporting.odin b/core/testing/reporting.odin index d06681c2d..fba67d67f 100644 --- a/core/testing/reporting.odin +++ b/core/testing/reporting.odin @@ -271,7 +271,11 @@ needs_to_redraw :: proc(report: Report) -> bool { } draw_status_bar :: proc(w: io.Writer, threads_string: string, total_done_count, total_test_count: int) { - if total_done_count != total_test_count { + if total_done_count == total_test_count { + // All tests are done; print a blank line to maintain the same height + // of the progress report. + fmt.wprintln(w) + } else { fmt.wprintfln(w, "%s % 4i/% 4i :: total", threads_string, diff --git a/core/testing/runner.odin b/core/testing/runner.odin index 3a024d090..734b143a6 100644 --- a/core/testing/runner.odin +++ b/core/testing/runner.odin @@ -583,8 +583,14 @@ runner :: proc(internal_tests: []Internal_Test) -> bool { finished_in := time.since(start_time) + when !FANCY_OUTPUT { + // One line to space out the results, since we don't have the status + // bar in plain mode. + fmt.wprintln(batch_writer) + } + fmt.wprintf(batch_writer, - "\nFinished %i test%s in %v.", + "Finished %i test%s in %v.", total_done_count, "" if total_done_count == 1 else "s", finished_in) |