diff options
| author | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2025-06-26 12:46:03 -0400 |
|---|---|---|
| committer | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2025-06-26 12:46:03 -0400 |
| commit | c87655525df19b53d8b8815b5b397c5b1c512538 (patch) | |
| tree | 4666dd66722e2ca23de5d947cc7588cefe4da43b /core/testing/runner.odin | |
| parent | edf071903d33f73e0dc642bbdffc1e868901e632 (diff) | |
testing: Make test state changes its own feature
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.
Diffstat (limited to 'core/testing/runner.odin')
| -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 cb1da9445..b53bd8722 100644 --- a/core/testing/runner.odin +++ b/core/testing/runner.odin @@ -57,6 +57,8 @@ SHARED_RANDOM_SEED : u64 : #config(ODIN_TEST_RANDOM_SEED, 0) // Set the lowest log level for this test run. LOG_LEVEL_DEFAULT : string : "debug" when ODIN_DEBUG else "info" LOG_LEVEL : string : #config(ODIN_TEST_LOG_LEVEL, LOG_LEVEL_DEFAULT) +// Report a message at the info level when a test has changed its state. +LOG_STATE_CHANGES : bool : #config(ODIN_TEST_LOG_STATE_CHANGES, false) // Show only the most necessary logging information. USING_SHORT_LOGS : bool : #config(ODIN_TEST_SHORT_LOGS, false) // Output a report of the tests to the given path. @@ -631,8 +633,8 @@ runner :: proc(internal_tests: []Internal_Test) -> bool { total_done_count += 1 } - when ODIN_DEBUG { - log.debugf("Test #%i %s.%s changed state to %v.", task_channel.test_index, it.pkg, it.name, event.new_state) + when LOG_STATE_CHANGES { + log.infof("Test #%i %s.%s changed state to %v.", task_channel.test_index, it.pkg, it.name, event.new_state) } pkg.last_change_state = event.new_state |