Skip to content

Commit 7c079e9

Browse files
laura-naoshuahkh
authored andcommitted
selftests: Move KTAP bash helpers to selftests common folder
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>
1 parent 8cbf22b commit 7c079e9

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

tools/testing/selftests/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ ifdef INSTALL_PATH
236236
install -m 744 kselftest/module.sh $(INSTALL_PATH)/kselftest/
237237
install -m 744 kselftest/runner.sh $(INSTALL_PATH)/kselftest/
238238
install -m 744 kselftest/prefix.pl $(INSTALL_PATH)/kselftest/
239+
install -m 744 kselftest/ktap_helpers.sh $(INSTALL_PATH)/kselftest/
239240
install -m 744 run_kselftest.sh $(INSTALL_PATH)/
240241
rm -f $(TEST_LIST)
241242
@ret=1; \

tools/testing/selftests/dt/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ifneq ($(PY3),)
44

55
TEST_PROGS := test_unprobed_devices.sh
66
TEST_GEN_FILES := compatible_list
7-
TEST_FILES := compatible_ignore_list ktap_helpers.sh
7+
TEST_FILES := compatible_ignore_list
88

99
include ../lib.mk
1010

tools/testing/selftests/dt/test_unprobed_devices.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,12 @@
1515

1616
DIR="$(dirname $(readlink -f "$0"))"
1717

18-
source "${DIR}"/ktap_helpers.sh
18+
source "${DIR}"/../kselftest/ktap_helpers.sh
1919

2020
PDT=/proc/device-tree/
2121
COMPAT_LIST="${DIR}"/compatible_list
2222
IGNORE_LIST="${DIR}"/compatible_ignore_list
2323

24-
KSFT_PASS=0
25-
KSFT_FAIL=1
26-
KSFT_SKIP=4
27-
2824
ktap_print_header
2925

3026
if [[ ! -d "${PDT}" ]]; then

tools/testing/selftests/dt/ktap_helpers.sh renamed to tools/testing/selftests/kselftest/ktap_helpers.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ KTAP_CNT_PASS=0
99
KTAP_CNT_FAIL=0
1010
KTAP_CNT_SKIP=0
1111

12+
KSFT_PASS=0
13+
KSFT_FAIL=1
14+
KSFT_XFAIL=2
15+
KSFT_XPASS=3
16+
KSFT_SKIP=4
17+
1218
ktap_print_header() {
1319
echo "TAP version 13"
1420
}

0 commit comments

Comments
 (0)