diff options
author | Javier Martinez Canillas <javierm@redhat.com> | 2023-04-02 08:45:09 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2023-04-02 08:47:04 +0300 |
commit | fdefcbdd6f3618410a0afb2ac0071c04036f9602 (patch) | |
tree | d23042539599333587fbbbeb46e60b2030a0036d /drivers/input/Kconfig | |
parent | 57d94d150d17754ae1b4e87e9a883155cbb3ab05 (diff) | |
download | linux-fdefcbdd6f3618410a0afb2ac0071c04036f9602.tar.xz |
Input: Add KUnit tests for some of the input core helper functions
The input subsystem doesn't currently have any unit tests, let's add a
CONFIG_INPUT_KUNIT_TEST option that builds a test suite to be executed
with the KUnit test infrastructure.
For now, only three tests were added for some of the input core helper
functions that are trivial to test:
* input_test_polling: set/get poll interval and set-up a poll handler.
* input_test_timestamp: set/get input event timestamps.
* input_test_match_device_id: match a device by bus, vendor, product,
version and events capable of handling.
But having the minimal KUnit support allows to add more tests and suites
as follow-up changes. The tests can be run with the following command:
$ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/input/tests/
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Enric Balletbo i Serra <eballetbo@redhat.com>
config: powerpc-allnoconfig (https://download.01.org/0day-ci/archive/20230330/202303301815.kRKFM3NH-lkp@intel.com/config)
Link: https://lore.kernel.org/r/20230330081831.2291351-1-javierm@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/Kconfig')
-rw-r--r-- | drivers/input/Kconfig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig index e2752f7364bc..735f90b74ee5 100644 --- a/drivers/input/Kconfig +++ b/drivers/input/Kconfig @@ -166,6 +166,16 @@ config INPUT_EVBUG To compile this driver as a module, choose M here: the module will be called evbug. +config INPUT_KUNIT_TEST + tristate "KUnit tests for Input" if !KUNIT_ALL_TESTS + depends on INPUT && KUNIT=y + default KUNIT_ALL_TESTS + help + Say Y here if you want to build the KUnit tests for the input + subsystem. + + If in doubt, say "N". + config INPUT_APMPOWER tristate "Input Power Event -> APM Bridge" if EXPERT depends on INPUT && APM_EMULATION |