aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2024-08-14 16:29:51 +0200
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2024-08-14 16:29:51 +0200
commitf7234e2ed3b2ea167d5fdbef1bdb92b96b9a053b (patch)
tree56b94d705ddb08c0235102bade9f333d7bc79d18
parente810c3eacec9cae74a369c747bbc5bd2a386d20d (diff)
Allow ODIN_TEST_LOG_LEVEL override when -debug.
-rw-r--r--core/testing/runner.odin20
-rw-r--r--tests/.gitignore3
2 files changed, 11 insertions, 12 deletions
diff --git a/core/testing/runner.odin b/core/testing/runner.odin
index 82cd58c75..ac679c8a2 100644
--- a/core/testing/runner.odin
+++ b/core/testing/runner.odin
@@ -53,24 +53,20 @@ PROGRESS_WIDTH : int : #config(ODIN_TEST_PROGRESS_WIDTH, 24)
// If it is unspecified, it will be set to the system cycle counter at startup.
SHARED_RANDOM_SEED : u64 : #config(ODIN_TEST_RANDOM_SEED, 0)
// Set the lowest log level for this test run.
-LOG_LEVEL : string : #config(ODIN_TEST_LOG_LEVEL, "info")
+LOG_LEVEL_DEFAULT : string : "debug" when ODIN_DEBUG else "info"
+LOG_LEVEL : string : #config(ODIN_TEST_LOG_LEVEL, LOG_LEVEL_DEFAULT)
// 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.
JSON_REPORT : string : #config(ODIN_TEST_JSON_REPORT, "")
get_log_level :: #force_inline proc() -> runtime.Logger_Level {
- when ODIN_DEBUG {
- // Always use .Debug in `-debug` mode.
- return .Debug
- } else {
- when LOG_LEVEL == "debug" { return .Debug } else
- when LOG_LEVEL == "info" { return .Info } else
- when LOG_LEVEL == "warning" { return .Warning } else
- when LOG_LEVEL == "error" { return .Error } else
- when LOG_LEVEL == "fatal" { return .Fatal } else {
- #panic("Unknown `ODIN_TEST_LOG_LEVEL`: \"" + LOG_LEVEL + "\", possible levels are: \"debug\", \"info\", \"warning\", \"error\", or \"fatal\".")
- }
+ when LOG_LEVEL == "debug" { return .Debug } else
+ when LOG_LEVEL == "info" { return .Info } else
+ when LOG_LEVEL == "warning" { return .Warning } else
+ when LOG_LEVEL == "error" { return .Error } else
+ when LOG_LEVEL == "fatal" { return .Fatal } else {
+ #panic("Unknown `ODIN_TEST_LOG_LEVEL`: \"" + LOG_LEVEL + "\", possible levels are: \"debug\", \"info\", \"warning\", \"error\", or \"fatal\".")
}
}
diff --git a/tests/.gitignore b/tests/.gitignore
index ce17927b4..e8cdc9e79 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -13,6 +13,9 @@
# But remember to ignore executables with an extension.
*.exe
*.bin
+*.bat
+*.pdb
+*.sh
# Ignore documentation-related files.
/documentation/verify/