]> git.proxmox.com Git - mirror_ubuntu-kernels.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)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:46:50 +0000 (16:46 +0100)
commitab8f59e2864a8f3dcfc4f315200a6c76f06355cb
tree6ff5045a0331f6e8b0882d0c4a271298920d4e7f
parentc483f4149daf94ff3ac9d9ecaa5320bb238d6f70
selftests: find echo binary to use -ne options

BugLink: https://bugs.launchpad.net/bugs/2011425
[ Upstream commit 4ebe33398c40c1118b4d8546978036c0e0032d1b ]

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: 3297a4df805d ("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>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
tools/testing/selftests/Makefile