diff options
| author | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-06-02 23:21:44 -0400 |
|---|---|---|
| committer | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-06-02 23:21:44 -0400 |
| commit | fa29974dabc03479848935168eb4e26becbe304d (patch) | |
| tree | 4b0f46f40d4f2a1af5bd9ea2c246908034306e02 | |
| parent | 7764ab2ab0a45786d3c27c2a5bfad264e181b7b7 (diff) | |
Use `Warning` log level for reporting memory leaks
Works well with `-define:ODIN_TEST_LOG_LEVEL=warning`.
| -rw-r--r-- | core/testing/runner.odin | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/testing/runner.odin b/core/testing/runner.odin index 190e10744..c82aa1fda 100644 --- a/core/testing/runner.odin +++ b/core/testing/runner.odin @@ -467,16 +467,18 @@ runner :: proc(internal_tests: []Internal_Test) -> bool { when TRACKING_MEMORY { #no_bounds_check tracker := &task_memory_trackers[data.allocator_index] + memory_is_in_bad_state := len(tracker.allocation_map) + len(tracker.bad_free_array) > 0 + when ALWAYS_REPORT_MEMORY { should_report := true } else { - should_report := len(tracker.allocation_map) + len(tracker.bad_free_array) > 0 + should_report := memory_is_in_bad_state } if should_report { write_memory_report(batch_writer, tracker, data.it.pkg, data.it.name) - pkg_log.info(bytes.buffer_to_string(&batch_buffer)) + pkg_log.log(.Warning if memory_is_in_bad_state else .Info, bytes.buffer_to_string(&batch_buffer)) bytes.buffer_reset(&batch_buffer) } |