linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: Move KTAP bash helpers to selftests common folder
@ 2024-01-02 14:15 Laura Nao
  2024-01-02 20:32 ` Nícolas F. R. A. Prado
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Laura Nao @ 2024-01-02 14:15 UTC (permalink / raw)
  To: Shuah Khan, Rob Herring, Frank Rowand
  Cc: Miguel Ojeda, Nicolas F . R . A . Prado, linux-kselftest,
	linux-kernel, devicetree, kernel, Laura Nao

Move bash helpers for outputting in KTAP format to the common selftests
folder. This allows kselftests other than the dt one to source the file
and make use of the helper functions.
Define pass, fail and skip codes in the same file too.

Signed-off-by: Laura Nao <laura.nao@collabora.com>
---
 tools/testing/selftests/Makefile                          | 1 +
 tools/testing/selftests/dt/Makefile                       | 2 +-
 tools/testing/selftests/dt/test_unprobed_devices.sh       | 6 +-----
 tools/testing/selftests/{dt => kselftest}/ktap_helpers.sh | 6 ++++++
 4 files changed, 9 insertions(+), 6 deletions(-)
 rename tools/testing/selftests/{dt => kselftest}/ktap_helpers.sh (94%)

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 3b2061d1c1a5..976e96013c91 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -251,6 +251,7 @@ ifdef INSTALL_PATH
 	install -m 744 kselftest/module.sh $(INSTALL_PATH)/kselftest/
 	install -m 744 kselftest/runner.sh $(INSTALL_PATH)/kselftest/
 	install -m 744 kselftest/prefix.pl $(INSTALL_PATH)/kselftest/
+	install -m 744 kselftest/ktap_helpers.sh $(INSTALL_PATH)/kselftest/
 	install -m 744 run_kselftest.sh $(INSTALL_PATH)/
 	rm -f $(TEST_LIST)
 	@ret=1;	\
diff --git a/tools/testing/selftests/dt/Makefile b/tools/testing/selftests/dt/Makefile
index 62dc00ee4978..2d33ee9e9b71 100644
--- a/tools/testing/selftests/dt/Makefile
+++ b/tools/testing/selftests/dt/Makefile
@@ -4,7 +4,7 @@ ifneq ($(PY3),)
 
 TEST_PROGS := test_unprobed_devices.sh
 TEST_GEN_FILES := compatible_list
-TEST_FILES := compatible_ignore_list ktap_helpers.sh
+TEST_FILES := compatible_ignore_list
 
 include ../lib.mk
 
diff --git a/tools/testing/selftests/dt/test_unprobed_devices.sh b/tools/testing/selftests/dt/test_unprobed_devices.sh
index b07af2a4c4de..f2307ee443a6 100755
--- a/tools/testing/selftests/dt/test_unprobed_devices.sh
+++ b/tools/testing/selftests/dt/test_unprobed_devices.sh
@@ -15,16 +15,12 @@
 
 DIR="$(dirname $(readlink -f "$0"))"
 
-source "${DIR}"/ktap_helpers.sh
+source "${DIR}"/../kselftest/ktap_helpers.sh
 
 PDT=/proc/device-tree/
 COMPAT_LIST="${DIR}"/compatible_list
 IGNORE_LIST="${DIR}"/compatible_ignore_list
 
-KSFT_PASS=0
-KSFT_FAIL=1
-KSFT_SKIP=4
-
 ktap_print_header
 
 if [[ ! -d "${PDT}" ]]; then
diff --git a/tools/testing/selftests/dt/ktap_helpers.sh b/tools/testing/selftests/kselftest/ktap_helpers.sh
similarity index 94%
rename from tools/testing/selftests/dt/ktap_helpers.sh
rename to tools/testing/selftests/kselftest/ktap_helpers.sh
index 8dfae51bb4e2..dd79d96f3b5a 100644
--- a/tools/testing/selftests/dt/ktap_helpers.sh
+++ b/tools/testing/selftests/kselftest/ktap_helpers.sh
@@ -9,6 +9,12 @@ KTAP_CNT_PASS=0
 KTAP_CNT_FAIL=0
 KTAP_CNT_SKIP=0
 
+KSFT_PASS=0
+KSFT_FAIL=1
+KSFT_XFAIL=2
+KSFT_XPASS=3
+KSFT_SKIP=4
+
 ktap_print_header() {
 	echo "TAP version 13"
 }
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] selftests: Move KTAP bash helpers to selftests common folder
  2024-01-02 14:15 [PATCH] selftests: Move KTAP bash helpers to selftests common folder Laura Nao
@ 2024-01-02 20:32 ` Nícolas F. R. A. Prado
  2024-01-22 16:06 ` Rob Herring
  2024-02-12 15:01 ` Nícolas F. R. A. Prado
  2 siblings, 0 replies; 5+ messages in thread
From: Nícolas F. R. A. Prado @ 2024-01-02 20:32 UTC (permalink / raw)
  To: Laura Nao
  Cc: Shuah Khan, Rob Herring, Frank Rowand, Miguel Ojeda,
	linux-kselftest, linux-kernel, devicetree, kernel

On Tue, Jan 02, 2024 at 03:15:28PM +0100, Laura Nao wrote:
> Move bash helpers for outputting in KTAP format to the common selftests
> folder. This allows kselftests other than the dt one to source the file
> and make use of the helper functions.
> Define pass, fail and skip codes in the same file too.
> 
> Signed-off-by: Laura Nao <laura.nao@collabora.com>

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Thanks,
Nícolas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] selftests: Move KTAP bash helpers to selftests common folder
  2024-01-02 14:15 [PATCH] selftests: Move KTAP bash helpers to selftests common folder Laura Nao
  2024-01-02 20:32 ` Nícolas F. R. A. Prado
@ 2024-01-22 16:06 ` Rob Herring
  2024-02-12 15:01 ` Nícolas F. R. A. Prado
  2 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2024-01-22 16:06 UTC (permalink / raw)
  To: Laura Nao
  Cc: Shuah Khan, Frank Rowand, Miguel Ojeda, Nicolas F . R . A . Prado,
	linux-kselftest, linux-kernel, devicetree, kernel

On Tue, Jan 02, 2024 at 03:15:28PM +0100, Laura Nao wrote:
> Move bash helpers for outputting in KTAP format to the common selftests
> folder. This allows kselftests other than the dt one to source the file
> and make use of the helper functions.
> Define pass, fail and skip codes in the same file too.
> 
> Signed-off-by: Laura Nao <laura.nao@collabora.com>
> ---
>  tools/testing/selftests/Makefile                          | 1 +
>  tools/testing/selftests/dt/Makefile                       | 2 +-
>  tools/testing/selftests/dt/test_unprobed_devices.sh       | 6 +-----
>  tools/testing/selftests/{dt => kselftest}/ktap_helpers.sh | 6 ++++++
>  4 files changed, 9 insertions(+), 6 deletions(-)
>  rename tools/testing/selftests/{dt => kselftest}/ktap_helpers.sh (94%)

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] selftests: Move KTAP bash helpers to selftests common folder
  2024-01-02 14:15 [PATCH] selftests: Move KTAP bash helpers to selftests common folder Laura Nao
  2024-01-02 20:32 ` Nícolas F. R. A. Prado
  2024-01-22 16:06 ` Rob Herring
@ 2024-02-12 15:01 ` Nícolas F. R. A. Prado
  2024-02-20 22:59   ` Shuah Khan
  2 siblings, 1 reply; 5+ messages in thread
From: Nícolas F. R. A. Prado @ 2024-02-12 15:01 UTC (permalink / raw)
  To: Laura Nao
  Cc: Shuah Khan, Rob Herring, Frank Rowand, Miguel Ojeda,
	linux-kselftest, linux-kernel, devicetree, kernel

On Tue, Jan 02, 2024 at 03:15:28PM +0100, Laura Nao wrote:
> Move bash helpers for outputting in KTAP format to the common selftests
> folder. This allows kselftests other than the dt one to source the file
> and make use of the helper functions.
> Define pass, fail and skip codes in the same file too.
> 
> Signed-off-by: Laura Nao <laura.nao@collabora.com>
> ---

Hi Shuah, any thoughts on this patch?

It's gotten Rob's ack, so I take this will be merged through your tree.

Thanks,
Nícolas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] selftests: Move KTAP bash helpers to selftests common folder
  2024-02-12 15:01 ` Nícolas F. R. A. Prado
@ 2024-02-20 22:59   ` Shuah Khan
  0 siblings, 0 replies; 5+ messages in thread
From: Shuah Khan @ 2024-02-20 22:59 UTC (permalink / raw)
  To: Nícolas F. R. A. Prado, Laura Nao
  Cc: Shuah Khan, Rob Herring, Frank Rowand, Miguel Ojeda,
	linux-kselftest, linux-kernel, devicetree, kernel, Shuah Khan

On 2/12/24 08:01, Nícolas F. R. A. Prado wrote:
> On Tue, Jan 02, 2024 at 03:15:28PM +0100, Laura Nao wrote:
>> Move bash helpers for outputting in KTAP format to the common selftests
>> folder. This allows kselftests other than the dt one to source the file
>> and make use of the helper functions.
>> Define pass, fail and skip codes in the same file too.
>>
>> Signed-off-by: Laura Nao <laura.nao@collabora.com>
>> ---
> 
> Hi Shuah, any thoughts on this patch?
> 
> It's gotten Rob's ack, so I take this will be merged through your tree.
> 
> Thanks,
> Nícolas

Applied to next for Linux 6.9-rc1

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-20 22:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-02 14:15 [PATCH] selftests: Move KTAP bash helpers to selftests common folder Laura Nao
2024-01-02 20:32 ` Nícolas F. R. A. Prado
2024-01-22 16:06 ` Rob Herring
2024-02-12 15:01 ` Nícolas F. R. A. Prado
2024-02-20 22:59   ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).