1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 00:15:58 +01:00

Add help option to test command line args

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.
This commit is contained in:
Dennis Skinner
2023-12-02 03:05:32 -05:00
parent bf560290f6
commit 985f6e0194
2 changed files with 46 additions and 1 deletions

View File

@@ -1158,9 +1158,43 @@ RUNNER_TESTS = [
:to_pass => [ ],
:to_fail => [ ],
:to_ignore => [ ],
:text => [ "ERROR: Unknown Option z" ],
:text => [
"ERROR: Unknown Option z",
"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",
"-h Show this help menu",
"-q Quiet/Decrease verbosity",
"-v Increase verbosity",
"-x TEST Exclude tests with TEST in the name",
],
}
},
{ :name => 'ArgsHelp',
:testfile => 'testdata/testRunnerGenerator.c',
:testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'],
:options => {
:cmdline_args => true,
},
:cmdline_args => "-h",
:expected => {
:to_pass => [ ],
:to_fail => [ ],
:to_ignore => [ ],
:text => [
"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",
"-h Show this help menu",
"-q Quiet/Decrease verbosity",
"-v Increase verbosity",
"-x TEST Exclude tests with TEST in the name",
],
}
},
]
def runner_test(test, runner, expected, test_defines, cmdline_args, features)