kunit: tool: show list of valid --arch options when invalid
authorDaniel Latypov <dlatypov@google.com>
Wed, 29 Sep 2021 23:25:34 +0000 (16:25 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 19 Oct 2021 20:18:50 +0000 (14:18 -0600)
commitfe678fed2cda4c74d016171dce290b792b036663
treefe3bd582f0c8cfa0941357144b7f249d695758eb
parenta54ea2e0572537b283cb0edd95851c5f1fb20a90
kunit: tool: show list of valid --arch options when invalid

Consider this attempt to run KUnit in QEMU:
$ ./tools/testing/kunit/kunit.py run --arch=x86

Before you'd get this error message:
kunit_kernel.ConfigError: x86 is not a valid arch

After:
kunit_kernel.ConfigError: x86 is not a valid arch, options are ['alpha', 'arm', 'arm64', 'i386', 'powerpc', 'riscv', 's390', 'sparc', 'x86_64']

This should make it a bit easier for people to notice when they make
typos, etc. Currently, one would have to dive into the python code to
figure out what the valid set is.

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>
tools/testing/kunit/kunit_kernel.py
tools/testing/kunit/kunit_tool_test.py