-
-
Notifications
You must be signed in to change notification settings - Fork 312
Add test option --test-log-level to choose tests' log level
#2560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
01d2aa7 to
b9822e5
Compare
|
Made argument passed to |
|
(bump @lerno) |
src/build/build_options.c
Outdated
| options->test_filter = next_arg(); | ||
| return; | ||
| } | ||
| if (match_longopt("test-log-level")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better use match_argopt with the different options here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see from the other examples how it works.
lib/std/core/runtime_test.c3
Outdated
| io::printn("Missing log level for argument `--test-log-level`."); | ||
| return false; | ||
| } | ||
| args[i + 1].convert_to_lower(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you convert it to upper case instead, you can use enum_by_name(LogPriority, args[i + 1]) and drop the switch.
lib/std/core/runtime_test.c3
Outdated
| case "critical": context.log_level = LogPriority.CRITICAL; | ||
| default: | ||
| io::print("Log level given to `--test-log-level` is not one of: "); | ||
| $foreach $level : LogPriority.names[:^1]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since LogPriority will not change, just write this as a hard coded description rather than grabbing the names.
|
I'll look at this on Friday. Remind me if I forget. |
|
Thank you! |
No description provided.