linux/tools/testing/kunit
Daniel Latypov baa3331503 kunit: tool: more descriptive metavars/--help output
Before, our help output contained lines like
  --kconfig_add KCONFIG_ADD
  --qemu_config qemu_config
  --jobs jobs

They're not very helpful.

The former kind come from the automatic 'metavar' we get from argparse,
the uppercase version of the flag name.
The latter are where we manually specified metavar as the flag name.

After:
  --build_dir DIR
  --make_options X=Y
  --kunitconfig PATH
  --kconfig_add CONFIG_X=Y
  --arch ARCH
  --cross_compile PREFIX
  --qemu_config FILE
  --jobs N
  --timeout SECONDS
  --raw_output [{all,kunit}]
  --json [FILE]

This patch tries to make the code more clear by specifying the _type_ of
input we expect, e.g. --build_dir is a DIR, --qemu_config is a FILE.
I also switched it to uppercase since it looked more clearly like
placeholder text that way.

This patch also changes --raw_output to specify `choices` to make it
more clear what the options are, and this way argparse can validate it
for us, as shown by the added test case.

Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-04-04 16:22:14 -06:00
..
configs kunit: Remove the unused all_tests.config 2021-06-23 17:49:41 -06:00
qemu_configs kunit: tool: add support for QEMU 2021-06-11 16:10:23 -06:00
test_data kunit: tool: Report an error if any test has no subtests 2021-12-13 13:36:15 -07:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
kunit.py kunit: tool: more descriptive metavars/--help output 2022-04-04 16:22:14 -06:00
kunit_config.py kunit: tool: drop last uses of collections.namedtuple 2022-04-04 14:25:53 -06:00
kunit_json.py kunit: tool: properly report the used arch for --json, or '' if not known 2022-04-04 15:22:30 -06:00
kunit_kernel.py kunit: tool: properly report the used arch for --json, or '' if not known 2022-04-04 15:22:30 -06:00
kunit_parser.py kunit: tool: Do not colorize output when redirected 2022-04-04 15:23:50 -06:00
kunit_tool_test.py kunit: tool: more descriptive metavars/--help output 2022-04-04 16:22:14 -06:00
qemu_config.py kunit: tool: drop last uses of collections.namedtuple 2022-04-04 14:25:53 -06:00
run_checks.py kunit: fix missing f in f-string in run_checks.py 2022-02-02 11:12:15 -07:00