aboutsummaryrefslogtreecommitdiff
path: root/core/testing/runner.odin
Commit message (Collapse)AuthorAgeFilesLines
* testing: Make test state changes its own featureFeoramund2025-06-261-2/+4
| | | | | | | This patch takes the former debug message output of a test changing its state and makes it its own feature, toggleable with the `ODIN_TEST_LOG_STATE_CHANGES` configurable. The output will be at the info level and is disabled by default.
* testing: Add API to expect signals and assertion failuresFeoramund2025-06-161-3/+8
|
* Restructure `core:terminal` for better Windows supportFeoramund2025-05-211-8/+0
|
* Add animation detection support to test runnerFeoramund2025-05-201-59/+76
|
* Add terminal color detection to logging in `core:testing`Feoramund2025-05-201-2/+17
|
* Rename `core:encoding/ansi` to `core:terminal/ansi`Feoramund2025-05-201-1/+1
|
* Restore console mode when test runner exits.Jeroen van Rijn2025-05-201-0/+4
|
* Makes tracking allocator default to crashing on a bad free instead of add to ↵Karl Zylinski2024-12-211-0/+1
| | | | bad_free_array. The bad_free_array remains to not break old code. The new default behavior is implemented in a callback that you can override, there's a second provided callback that provides the old behavior where an element was added to bad_free_array. Rationale: Many people are just checking the allocation_map, but don't check the bad free array. Several examples throughout core that use tracking allocator don't check bad_free_array either, so people have been taught not to check it.
* Merge branch 'master' into file-tags-without-commentsKarl Zylinski2024-09-171-0/+4
|\
| * init ansi on a standalone testing exeavanspector2024-09-171-0/+4
| |
* | Moved all packages in core, base, vendor, tests and examples to use new #+ ↵Karl Zylinski2024-09-141-1/+1
|/ | | | file tag syntax.
* Remove deprecated `log` procs from `core:testing`Feoramund2024-08-181-15/+15
|
* Allow ODIN_TEST_LOG_LEVEL override when -debug.Jeroen van Rijn2024-08-141-12/+8
|
* Add explicit copyright info to `core:testing`Feoramund2024-08-121-0/+9
|
* Fix wrong define name in test runner log messagesFeoramund2024-08-111-2/+2
|
* Optionally treat memory failures as errors in the test runnerFeoramund2024-08-111-41/+57
| | | | Enable with `-define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true`.
* Allow testing for intentional leaks in test runnerJeroen van Rijn2024-08-081-3/+35
| | | | | | | | | | | 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.
* Begin mapping `os.Error` in the rest of the codebasegingerBill2024-08-041-2/+2
|
* testing: add json reportingLaytan Laats2024-07-241-1/+45
|
* fix some bugs with -disable-assertLaytan Laats2024-07-161-2/+2
|
* Update `core` to `-strict-style`gingerBill2024-06-291-6/+5
|
* Let `-vet` be used with `-define:ODIN_TEST_NAMES`Feoramund2024-06-281-1/+4
|
* Work around Windows test failureFeoramund2024-06-181-3/+7
| | | | | | | | | | | | | | | | | | | | I am uncertain why this works, but it does. Previously, `rtti_test` was failing due to non-zero data appearing in the `l_buggy` `Buggy_Struct`. The issue was caused by calling `runtime.default_random_generator` with a pointer to the state, somehow. The pointer could be on the stack or in the heap; it did not matter. I found two workarounds. - One is to move the RNG setup behind the call to `free_all`. - The other is to construct the random generator manually. Despite my digging and testing, I could find no reason as to why this works or what the fundamental issue was to begin with. If anyone comes upon this in the future with direct access to a Windows machine, I recommend stepping through the program with a debugger to investigate more deeply into why this happens.
* Setup default `context.random_generator` for testsFeoramund2024-06-151-0/+4
|
* Merge pull request #3765 from Feoramund/add-short-test-logsJeroen van Rijn2024-06-151-0/+2
|\ | | | | Add `ODIN_TEST_SHORT_LOGS` define
| * Add `ODIN_TEST_SHORT_LOGS` defineFeoramund2024-06-151-0/+2
| | | | | | | | | | Strips out the procedure, date, and time information, for when you just need to know the file, line, and message.
* | Make `testing.fail_now` divergentFeoramund2024-06-151-14/+23
| | | | | | | | This is in line with the old way it worked on Windows.
* | Call `cleanups` after test signalFeoramund2024-06-151-2/+9
|/
* add error message for unknown test log levelLaytan Laats2024-06-071-0/+3
| | | | | It would previously just be a compilation error about a missing return statement.
* Use `Warning` log level for reporting memory leaksFeoramund2024-06-021-2/+4
| | | | Works well with `-define:ODIN_TEST_LOG_LEVEL=warning`.
* Be pedantic about not overwriting Odin errorsFeoramund2024-06-021-4/+5
| | | | | | | | | | | | | | | | | | | 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`.
* Tell user about `ODIN_TEST_RANDOM_SEED` optionFeoramund2024-06-021-1/+5
|
* Keep test runner main thread from using 100% of a CPU coreFeoramund2024-06-021-0/+17
|
* Add `-define:ODIN_TEST_LOG_LEVEL` to set lowest log levelFeoramund2024-06-021-2/+17
|
* Log thread count at test run startFeoramund2024-06-021-0/+10
| | | | | Provides a helpful info message about the option to change how many threads are used per run.
* Make it easier to learn about `ODIN_TEST_CLIPBOARD`Feoramund2024-06-021-0/+1
|
* Add note about `SIGSEGV` edge case on UNIX-likesFeoramund2024-06-021-0/+7
|
* Remove Windows test runner in favor of `libc` implementationFeoramund2024-06-021-1/+1
|
* Expand documentation comment for `ODIN_TEST_NAMES`Feoramund2024-06-021-0/+3
|
* Use more concise way of satisfying `-vet`Feoramund2024-06-021-9/+4
|
* Catch `SIGILL`, `SIGFPE`, `SIGSEGV` in the test runnerFeoramund2024-06-021-2/+63
|
* Remove unneeded importFeoramund2024-06-021-1/+0
|
* Support deterministic random seeding of testsFeoramund2024-06-021-0/+14
| | | | | | | | 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).
* Report test memory usage only if there's an issueFeoramund2024-06-021-11/+27
| | | | | Adds new option `ODIN_TEST_ALWAYS_REPORT_MEMORY`, for when you always want to see the memory usage report.
* Track memory in the test runner by defaultFeoramund2024-06-021-1/+1
|
* Change test runner options to `SCREAMING_SNAKE_CASE`Feoramund2024-06-021-11/+11
| | | | | This commit also changes the name of `test_select` to `ODIN_TEST_NAMES`, to better conform with the already-existing `-test-name:<name>` option.
* Send terminal control code to `STDOUT` insteadFeoramund2024-06-021-1/+1
| | | | | `STDERR` might be redirected, and this code signals to the terminal to show the cursor again. Otherwise, the cursor will be invisible.
* Fix ANSI redraw eating last log lineFeoramund2024-06-021-1/+7
|
* Remove `safe_heap_allocator` from test runnerFeoramund2024-06-021-9/+3
| | | | | I was under the impression that the default `context.allocator` was not thread-safe, but I've been told that this is not the case.
* Use plain sort for `internal_tests`Feoramund2024-06-021-1/+1
|