mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-05 04:27:51 +00:00
Allow ODIN_TEST_LOG_LEVEL override when -debug.
This commit is contained in:
@@ -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\".")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
3
tests/.gitignore
vendored
3
tests/.gitignore
vendored
@@ -13,6 +13,9 @@
|
||||
# But remember to ignore executables with an extension.
|
||||
*.exe
|
||||
*.bin
|
||||
*.bat
|
||||
*.pdb
|
||||
*.sh
|
||||
|
||||
# Ignore documentation-related files.
|
||||
/documentation/verify/
|
||||
|
||||
Reference in New Issue
Block a user