]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: find echo binary to use -ne options
authorGuillaume Tucker <guillaume.tucker@collabora.com>
Fri, 3 Feb 2023 15:26:03 +0000 (16:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:27 +0000 (09:33 +0100)
commitb8dd58a3f7d0555e0007f7afa2295617a4414ce4
tree4003347bc5e2a4dfd6723c4ff20ef6c8fdcf626b
parentec11b0dcff6f2ce922e6ccc43e60703d633da941
selftests: find echo binary to use -ne options

[ Upstream commit c8b5fa6f48f93010b50598641c4d8de8a8e7e68c ]

Find the actual echo binary using $(which echo) and use it for
formatted output with -ne.  On some systems, the default echo command
doesn't handle the -e option and the output looks like this (arm64
build):

-ne Emit Tests for alsa

-ne Emit Tests for amd-pstate

-ne Emit Tests for arm64

This is for example the case with the KernelCI Docker images
e.g. kernelci/gcc-10:x86-kselftest-kernelci.  With the actual echo
binary (e.g. in /bin/echo), the output is formatted as expected (x86
build this time):

Emit Tests for alsa
Emit Tests for amd-pstate
Skipping non-existent dir: arm64

Only the install target is using "echo -ne" so keep the $ECHO variable
local to it.

Reported-by: "kernelci.org bot" <bot@kernelci.org>
Fixes: 99ae430547b1 ("kselftests: Enable the echo command to print newlines in Makefile")
Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/Makefile