Skip to content

Commit 9e34fad

Browse files
gctuckershuahkh
authored andcommitted
selftests: use printf instead of echo -ne
Rather than trying to guess which implementation of "echo" to run with support for "-ne" options, use "printf" instead of "echo -ne". It handles escape characters as a standard feature and it is widespread among modern shells. Reported-by: "kernelci.org bot" <[email protected]> Suggested-by: David Laight <[email protected]> Fixes: 3297a4d ("kselftests: Enable the echo command to print newlines in Makefile") Fixes: 79c16b1 ("selftests: find echo binary to use -ne options") Signed-off-by: Guillaume Tucker <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 1e6b485 commit 9e34fad

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tools/testing/selftests/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,10 @@ ifdef INSTALL_PATH
234234
@# While building kselftest-list.text skip also non-existent TARGET dirs:
235235
@# they could be the result of a build failure and should NOT be
236236
@# included in the generated runlist.
237-
ECHO=`which echo`; \
238237
for TARGET in $(TARGETS); do \
239238
BUILD_TARGET=$$BUILD/$$TARGET; \
240-
[ ! -d $(INSTALL_PATH)/$$TARGET ] && $$ECHO "Skipping non-existent dir: $$TARGET" && continue; \
241-
$$ECHO -ne "Emit Tests for $$TARGET\n"; \
239+
[ ! -d $(INSTALL_PATH)/$$TARGET ] && printf "Skipping non-existent dir: $$TARGET\n" && continue; \
240+
printf "Emit Tests for $$TARGET\n"; \
242241
$(MAKE) -s --no-print-directory OUTPUT=$$BUILD_TARGET COLLECTION=$$TARGET \
243242
-C $$TARGET emit_tests >> $(TEST_LIST); \
244243
done;

0 commit comments

Comments
 (0)