Commit Graph

15 Commits

Author SHA1 Message Date
Feoramund b7e1ae7073 Change test runner options to SCREAMING_SNAKE_CASE
This commit also changes the name of `test_select` to `ODIN_TEST_NAMES`,
to better conform with the already-existing `-test-name:<name>` option.
2024-06-02 14:47:07 -04:00
Feoramund dcfda195d2 Send terminal control code to STDOUT instead
`STDERR` might be redirected, and this code signals to the terminal to
show the cursor again. Otherwise, the cursor will be invisible.
2024-06-02 14:47:07 -04:00
Feoramund a1c5bebac7 Fix ANSI redraw eating last log line 2024-06-02 14:47:07 -04:00
Feoramund dffc3af86c Remove safe_heap_allocator from test runner
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.
2024-06-02 14:47:06 -04:00
Feoramund 1afc235359 Use plain sort for internal_tests 2024-06-02 14:47:06 -04:00
Feoramund b6c4dfb68d Refactor the test runner
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.
2024-06-02 14:34:31 -04:00
gingerBill b2164b5da6 Make the io/conv.odin utilities be #optional_ok 2021-09-29 13:24:42 +01:00
Jeroen van Rijn 97a46f664d testing: Strip ; from test runner. 2021-09-07 14:46:53 +02:00
gingerBill 364e6c9573 Move comment 2021-05-01 22:58:13 +01:00
gingerBill 52d38ae42b Make the core:testing runner on windows run in a separate thread to handle crashes in more safe manner 2021-05-01 22:54:27 +01:00
Jeroen van Rijn 0659a11a1a PNG: Fix tRNS handling. 2021-05-01 18:24:31 +02:00
gingerBill f5142aaec4 Change from test_* prefix to @(test) attribute for odin test 2021-03-14 18:43:21 +00:00
gingerBill db0ac2ba98 Add "NO TESTS RAN" message to testing.runner if no tests were ran 2021-03-14 18:17:00 +00:00
gingerBill 468ad4837b Add pkg field to testing.Internal_Test 2021-03-14 18:15:08 +00:00
gingerBill 2aa588209e odin test to work with the new core:testing package 2021-03-14 18:01:31 +00:00