-
Notifications
You must be signed in to change notification settings - Fork 992
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
Add help option to test command line args #706
Add help option to test command line args #706
Conversation
97d2f6e
to
e4ee687
Compare
When test binaries are run with unknown options or with the standard -h option, a help menu will print all available options. This is much more convenient than having to dig through unity.c to find every option.
e4ee687
to
985f6e0
Compare
Great idea. I also found it confusing when I have to check |
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.
Thanks for the awesome addition! I really appreciate the work. I have a couple minor suggested tweaks, if you don't mind?
src/unity.c
Outdated
case 'h': | ||
UnityPrint("Options: "); UNITY_PRINT_EOL(); | ||
UnityPrint("-l List all tests"); UNITY_PRINT_EOL(); | ||
UnityPrint("-f TEST Only run tests with TEST in the name"); UNITY_PRINT_EOL(); |
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.
Maybe change the wording to make it obvious what the function letter is? Something like "Filter to run only tests with TEST in the name"?
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.
Updated the options. If you'd prefer to choose exactly what to say I won't be offended.
P.S. TY for the timely review.
src/unity.c
Outdated
UnityPrint("Options: "); UNITY_PRINT_EOL(); | ||
UnityPrint("-l List all tests"); UNITY_PRINT_EOL(); | ||
UnityPrint("-f TEST Only run tests with TEST in the name"); UNITY_PRINT_EOL(); | ||
UnityPrint("-n TEST Only run tests with TEST in the name"); UNITY_PRINT_EOL(); |
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.
I'd not include the n
option... or if I did include it, mark it as deprecated
?
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.
$ git blame -L2289,2290 src/unity.c
4d3d062b (Mark VanderVoord 2016-06-21 16:07:10 -0400 2289) case 'n': /* include tests with name including this string */
1cecab30 (Mark VanderVoord 2016-07-08 17:35:37 -0400 2290) case 'f': /* an alias for -n */
It's still there, but yes, it would appear you later preferred -f
. -f
is a better mnemonic for filter anyways.
"Options:", | ||
"-l List all tests", | ||
"-f TEST Only run tests with TEST in the name", | ||
"-n TEST Only run tests with TEST in the name", |
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.
see above
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.
Marked as depreciated. I can remove it if you'd prefer.
When test binaries are run with unknown options or with the standard -h option, a help menu will print all available options.
This is much more convenient than having to dig through unity.c to find every option.