aboutsummaryrefslogtreecommitdiff
path: root/core/testing/testing.odin
Commit message (Collapse)AuthorAgeFilesLines
* testing: Add API to expect signals and assertion failuresFeoramund2025-06-161-0/+73
|
* add '#caller_expression'Laytan Laats2024-09-141-4/+8
|
* Remove deprecated `log` procs from `core:testing`Feoramund2024-08-181-28/+7
|
* Add explicit copyright info to `core:testing`Feoramund2024-08-121-1/+10
|
* Keep -vet happy when mem tracking is disabled.Jeroen van Rijn2024-08-081-0/+1
|
* Use test runner's own tracking allocator.Jeroen van Rijn2024-08-081-8/+7
|
* Allow testing for intentional leaks in test runnerJeroen van Rijn2024-08-081-1/+21
| | | | | | | | | | | 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.
* Imply `#no_capture` to all variadic parametersgingerBill2024-07-141-5/+5
|
* Add more uses of `#no_capture`gingerBill2024-07-141-5/+5
|
* Make `testing.fail_now` divergentFeoramund2024-06-151-5/+10
| | | | This is in line with the old way it worked on Windows.
* Call `cleanups` after test signalFeoramund2024-06-151-1/+11
|
* Support deterministic random seeding of testsFeoramund2024-06-021-0/+10
| | | | | | | | Add a new option `ODIN_TEST_RANDOM_SEED` which is picked from the cycle counter at startup, if it's not specified by the user. This number is sent to every test in the `T` struct and reset every test (just in case).
* Refactor the test runnerFeoramund2024-06-021-26/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes - Support multi-threaded testing. - Support `set_fail_timeout` on all platforms. - Display an animated progress report. - Setup all tests with a context logger. - Give all tests their own separate custom allocators. - Support tracking test memory usage. - Display a summary of the failed tests at the end. - Let users select only specific tests to run. - Support copying failed tests to the clipboard to run again. - Support catching SIGINT (CTRL-C) to cancel early. - Record context in cleanup procs. - Write all log messages to STDERR for easy redirection. - Possibly more I've forgotten. New Options - `-define:test_threads=N`: Specify thread count. - `-define:test_thread_memory=B`: Specify initial memory block size in bytes to each thread. - `-define:test_track_memory=true`: Track the memory usage of individual tests. - `-define:test_fancy=false`: Disable animated progress report. - `-define:test_select=package.test_name,...`: Run only select tests. - `-define:test_clipboard=true`: Copy names of failed tests to the clipboard. - `-define:test_progress_width=24`: Change the width of the animated progress bars.
* Merge pull request #3138 from FourteenBrush/mastergingerBill2024-01-291-2/+9
|\ | | | | Add a testing.expectf proc as a way to avoid a tprintf call.
| * Fix typoFourteenBrush2024-01-251-1/+1
| |
| * Need to unpack argsFourteenBrush2024-01-251-1/+1
| |
| * Forgot to include loc paramFourteenBrush2024-01-251-2/+1
| |
| * Add testing.expectfFourteenBrush2024-01-251-0/+8
| |
* | Replace `core:*` to `base:*` where appropriategingerBill2024-01-281-1/+1
|/
* fix: make -vet not complainramn2023-07-091-0/+2
|
* Fix #2637ramn2023-07-081-2/+3
| | | | where testing.expect_value can't compare nils
* Use positional and named arguments within the core librarygingerBill2023-06-211-5/+5
|
* Move assert to implementation filegingerBill2021-10-111-1/+0
|
* Add `testing.expect_value`; Improve `testing.set_fail_timeout`gingerBill2021-10-111-4/+10
|
* Add `testing.set_fail_timeout`gingerBill2021-10-111-4/+19
|
* testing: Strip ; from test runner.Jeroen van Rijn2021-09-071-19/+19
|
* Add `testing.fail_now`gingerBill2021-05-011-0/+9
|
* Make the core:testing runner on windows run in a separate thread to handle ↵gingerBill2021-05-011-2/+5
| | | | crashes in more safe manner
* Add `pkg` field to `testing.Internal_Test`gingerBill2021-03-141-0/+3
|
* `odin test` to work with the new `core:testing` packagegingerBill2021-03-141-0/+68