Add help option to test command line args#706
Add help option to test command line args#706mvandervoord merged 5 commits intoThrowTheSwitch:masterfrom
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 |
mvandervoord
left a comment
There was a problem hiding this comment.
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.
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.
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.
I'd not include the n option... or if I did include it, mark it as deprecated?
There was a problem hiding this comment.
$ 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.
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.