]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests: Move KTAP bash helpers to selftests common folder
authorLaura Nao <laura.nao@collabora.com>
Tue, 2 Jan 2024 14:15:28 +0000 (15:15 +0100)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 20 Feb 2024 22:52:55 +0000 (15:52 -0700)
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>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/Makefile
tools/testing/selftests/dt/Makefile
tools/testing/selftests/dt/test_unprobed_devices.sh
tools/testing/selftests/kselftest/ktap_helpers.sh [moved from tools/testing/selftests/dt/ktap_helpers.sh with 94% similarity]

index 15b6a111c3beaa180af9a1c81db2bed024b2da9c..c5b4574045b3006755d4555be7e109a0a121ba41 100644 (file)
@@ -236,6 +236,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; \
index 62dc00ee4978a46b1001bad62597d7589d261a75..2d33ee9e9b71ac2e0436abf8e35fe29af92a3cca 100644 (file)
@@ -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
 
index b07af2a4c4de0b680f37d510337d38b23691a478..f2307ee443a6d2b77cd262dba67b2d1901834b18 100755 (executable)
 
 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
similarity index 94%
rename from tools/testing/selftests/dt/ktap_helpers.sh
rename to tools/testing/selftests/kselftest/ktap_helpers.sh
index 8dfae51bb4e2e034b8d0e55ce120c41171bb981e..dd79d96f3b5ac13cf0fe2f545817b65fac094188 100644 (file)
@@ -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"
 }