diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2024-08-08 20:15:08 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2024-08-08 20:41:32 +0200 |
| commit | 80d1e1ba82cb21edb0a5263ea616d7105038bc0e (patch) | |
| tree | 34989f4b3660b4b0dc014c7d8732da8d2225d848 /src/unicode.cpp | |
| parent | 94c62fb630265f7c08726e7f15b4fb5cac0a3ad9 (diff) | |
Allow testing for intentional leaks in test runner
Adds `expect_leak_or_bad_free :: proc(t: ^T, client_test: proc(t: ^T), verifier: Memory_Verifier_Proc)`.
It sets up its own `Tracking_Allocator`, runs the `client_test`, and then calls the `verifier` procedure.
The verifier can then inspect the contents of the tracking allocator and call `testing.expect*` as sensible for the test in question.
Any allocations are then cleared so that the test runner doesn't itself complain about leaks.
Additionally, `ODIN_TEST_LOG_LEVEL_MEMORY` has been added as a define to set the severity of the test runner's memory tracker. You can use `-define:ODIN_TEST_LOG_LEVEL_MEMORY=error` to make tests fail rather than warn if leaks or bad frees have been found.
Diffstat (limited to 'src/unicode.cpp')
0 files changed, 0 insertions, 0 deletions