[PATCH] selftest: hid: add the missing tests directory

Yun Lu posted 1 patch 1 month, 2 weeks ago
There is a newer version of this series
tools/testing/selftests/hid/Makefile | 1 +
1 file changed, 1 insertion(+)
[PATCH] selftest: hid: add the missing tests directory
Posted by Yun Lu 1 month, 2 weeks ago
Commit 160c826b4dd0 ("selftest: hid: add missing run-hid-tools-tests.sh")
has added the run-hid-tools-tests.sh script for it to be installed, but
I forgot to add the tests directory together.

In fact, the run-hid-tools-tests.sh script uses the scripts in the tests
directory to run tests. The tests directory also needs to be added to be
installed.

Fixes: ffb85d5c9e80 ("selftests: hid: import hid-tools hid-core tests")
Cc: stable@vger.kernel.org
Signed-off-by: Yun Lu <luyun@kylinos.cn>
---
 tools/testing/selftests/hid/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/hid/Makefile b/tools/testing/selftests/hid/Makefile
index 38ae31bb07b5..662209f5fabc 100644
--- a/tools/testing/selftests/hid/Makefile
+++ b/tools/testing/selftests/hid/Makefile
@@ -18,6 +18,7 @@ TEST_PROGS += hid-usb_crash.sh
 TEST_PROGS += hid-wacom.sh
 
 TEST_FILES := run-hid-tools-tests.sh
+TEST_FILES += tests
 
 CXX ?= $(CROSS_COMPILE)g++
 
-- 
2.27.0
Re: [PATCH] selftest: hid: add the missing tests directory
Posted by Shuah Khan 1 month, 2 weeks ago
On 10/8/24 03:31, Yun Lu wrote:
> Commit 160c826b4dd0 ("selftest: hid: add missing run-hid-tools-tests.sh")
> has added the run-hid-tools-tests.sh script for it to be installed, but
> I forgot to add the tests directory together.
> 
> In fact, the run-hid-tools-tests.sh script uses the scripts in the tests
> directory to run tests. The tests directory also needs to be added to be
> installed
Include the error you are seeing in here.

> 
> Fixes: ffb85d5c9e80 ("selftests: hid: import hid-tools hid-core tests")
> Cc: stable@vger.kernel.org
> Signed-off-by: Yun Lu <luyun@kylinos.cn>
> ---
>   tools/testing/selftests/hid/Makefile | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/tools/testing/selftests/hid/Makefile b/tools/testing/selftests/hid/Makefile
> index 38ae31bb07b5..662209f5fabc 100644
> --- a/tools/testing/selftests/hid/Makefile
> +++ b/tools/testing/selftests/hid/Makefile
> @@ -18,6 +18,7 @@ TEST_PROGS += hid-usb_crash.sh
>   TEST_PROGS += hid-wacom.sh
>   
>   TEST_FILES := run-hid-tools-tests.sh
> +TEST_FILES += tests

What about the files if any under the tests directory?
The install rule would handle the case, however, did
you verify that those are copied as well?

>   
>   CXX ?= $(CROSS_COMPILE)g++
>   

thanks,
-- Shuah
Re: [PATCH] selftest: hid: add the missing tests directory
Posted by luyun 1 month, 2 weeks ago
在 2024/10/9 03:33, Shuah Khan 写道:
> On 10/8/24 03:31, Yun Lu wrote:
>> Commit 160c826b4dd0 ("selftest: hid: add missing 
>> run-hid-tools-tests.sh")
>> has added the run-hid-tools-tests.sh script for it to be installed, but
>> I forgot to add the tests directory together.
>>
>> In fact, the run-hid-tools-tests.sh script uses the scripts in the tests
>> directory to run tests. The tests directory also needs to be added to be
>> installed
> Include the error you are seeing in here.

If running the test case without the tests directory,  the error message 
will like this:

     cd $KSFT_INSTALL_PATH

     ./run_kselftest.sh -t hid:hid-core.sh


# /usr/lib/python3.11/site-packages/_pytest/config/__init__.py:331: 
PluggyTeardownRaisedWarning: A plugin raised an exception during an 
old-style hookwrapper teardown.
# Plugin: helpconfig, Hook: pytest_cmdline_parse
# UsageError: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...]
# __main__.py: error: unrecognized arguments: --udevd
#   inifile: None
#   rootdir: /root/linux/kselftest_install/hid


>
>>
>> Fixes: ffb85d5c9e80 ("selftests: hid: import hid-tools hid-core tests")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Yun Lu <luyun@kylinos.cn>
>> ---
>>   tools/testing/selftests/hid/Makefile | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/testing/selftests/hid/Makefile 
>> b/tools/testing/selftests/hid/Makefile
>> index 38ae31bb07b5..662209f5fabc 100644
>> --- a/tools/testing/selftests/hid/Makefile
>> +++ b/tools/testing/selftests/hid/Makefile
>> @@ -18,6 +18,7 @@ TEST_PROGS += hid-usb_crash.sh
>>   TEST_PROGS += hid-wacom.sh
>>     TEST_FILES := run-hid-tools-tests.sh
>> +TEST_FILES += tests
>
> What about the files if any under the tests directory?
> The install rule would handle the case, however, did
> you verify that those are copied as well?

Yes, the install rule will copy the entire directory (including all 
files under the directory),

and I have confirmed it.


Thanks and best regards.

--Yun Lu

>
>>     CXX ?= $(CROSS_COMPILE)g++
>
> thanks,
> -- Shuah
>