diff options
author | Shuah Khan <shuahkh@osg.samsung.com> | 2018-02-21 19:25:55 -0500 |
---|---|---|
committer | Shuah Khan <shuahkh@osg.samsung.com> | 2018-03-05 21:10:47 -0500 |
commit | 44f013522c3abbfb86e940026e3409dbb6e4317d (patch) | |
tree | 34fd7586048ed9ee2a468e445a3079db1a78926d /tools | |
parent | 771cbc3bcbb59084766a501772853f2de7009534 (diff) |
selftests: Makefile set KSFT_TAP_LEVEL to prevent nested TAP headers
Export KSFT_TAP_LEVEL and add TAP Header echo to the run_kselftest.sh
script from emit_tests target handling.
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/Makefile | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index 7442dfb73b7f..a41b4be28b9f 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile | |||
@@ -66,6 +66,12 @@ ifndef BUILD | |||
66 | BUILD := $(shell pwd) | 66 | BUILD := $(shell pwd) |
67 | endif | 67 | endif |
68 | 68 | ||
69 | # KSFT_TAP_LEVEL is used from KSFT framework to prevent nested TAP header | ||
70 | # printing from tests. Applicable to run_tests case where run_tests adds | ||
71 | # TAP header prior running tests and when a test program invokes another | ||
72 | # with system() call. Export it here to cover override RUN_TESTS defines. | ||
73 | export KSFT_TAP_LEVEL=`echo 1` | ||
74 | |||
69 | export BUILD | 75 | export BUILD |
70 | all: | 76 | all: |
71 | @for TARGET in $(TARGETS); do \ | 77 | @for TARGET in $(TARGETS); do \ |
@@ -125,10 +131,12 @@ ifdef INSTALL_PATH | |||
125 | echo "else" >> $(ALL_SCRIPT) | 131 | echo "else" >> $(ALL_SCRIPT) |
126 | echo " OUTPUT=/dev/stdout" >> $(ALL_SCRIPT) | 132 | echo " OUTPUT=/dev/stdout" >> $(ALL_SCRIPT) |
127 | echo "fi" >> $(ALL_SCRIPT) | 133 | echo "fi" >> $(ALL_SCRIPT) |
134 | echo "export KSFT_TAP_LEVEL=`echo 1`" >> $(ALL_SCRIPT) | ||
128 | 135 | ||
129 | for TARGET in $(TARGETS); do \ | 136 | for TARGET in $(TARGETS); do \ |
130 | BUILD_TARGET=$$BUILD/$$TARGET; \ | 137 | BUILD_TARGET=$$BUILD/$$TARGET; \ |
131 | echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \ | 138 | echo "echo ; echo TAP version 13" >> $(ALL_SCRIPT); \ |
139 | echo "echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \ | ||
132 | echo "echo ========================================" >> $(ALL_SCRIPT); \ | 140 | echo "echo ========================================" >> $(ALL_SCRIPT); \ |
133 | echo "cd $$TARGET" >> $(ALL_SCRIPT); \ | 141 | echo "cd $$TARGET" >> $(ALL_SCRIPT); \ |
134 | make -s --no-print-directory OUTPUT=$$BUILD_TARGET -C $$TARGET emit_tests >> $(ALL_SCRIPT); \ | 142 | make -s --no-print-directory OUTPUT=$$BUILD_TARGET -C $$TARGET emit_tests >> $(ALL_SCRIPT); \ |