[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABXOdTfMwx7OW_oNkkJ_rKT+EqohTa-xg4kfsHFx-Ep4uug6Qw@mail.gmail.com>
Date: Sat, 4 Feb 2023 07:18:42 -0800
From: Guenter Roeck <groeck@...gle.com>
To: Guillaume Tucker <guillaume.tucker@...labora.com>
Cc: Shuah Khan <shuah@...nel.org>,
Gautam <gautammenghani201@...il.com>,
David Laight <David.Laight@...lab.com>, kernel@...labora.com,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
kernelci@...ts.linux.dev
Subject: Re: [PATCH v2] selftests: use printf instead of echo -ne
On Sat, Feb 4, 2023 at 5:56 AM Guillaume Tucker
<guillaume.tucker@...labora.com> wrote:
>
> 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. To avoid this issue, use
> printf which handles escape characters as a standard feature and is
> more widespread among modern shells.
>
> The output is now formatted as expected (x86 build this time):
>
> Emit Tests for alsa
> Emit Tests for amd-pstate
> Skipping non-existent dir: arm64
>
> Reported-by: "kernelci.org bot" <bot@...nelci.org>
> Suggested-by: David Laight <David.Laight@...LAB.COM>
> Fixes: 3297a4df805d ("kselftests: Enable the echo command to print newlines in Makefile")
> Signed-off-by: Guillaume Tucker <guillaume.tucker@...labora.com>
Reviewed-by: Guenter Roeck <groeck@...omium.org>
> ---
>
> Notes:
> v2: use printf insead of $(which echo)
>
> tools/testing/selftests/Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
> index 41b649452560..06578963f4f1 100644
> --- a/tools/testing/selftests/Makefile
> +++ b/tools/testing/selftests/Makefile
> @@ -236,8 +236,8 @@ ifdef INSTALL_PATH
> @# included in the generated runlist.
> for TARGET in $(TARGETS); do \
> BUILD_TARGET=$$BUILD/$$TARGET; \
> - [ ! -d $(INSTALL_PATH)/$$TARGET ] && echo "Skipping non-existent dir: $$TARGET" && continue; \
> - echo -ne "Emit Tests for $$TARGET\n"; \
> + [ ! -d $(INSTALL_PATH)/$$TARGET ] && printf "Skipping non-existent dir: $$TARGET\n" && continue; \
> + printf "Emit Tests for $$TARGET\n"; \
> $(MAKE) -s --no-print-directory OUTPUT=$$BUILD_TARGET COLLECTION=$$TARGET \
> -C $$TARGET emit_tests >> $(TEST_LIST); \
> done;
> --
> 2.30.2
>
>
Powered by blists - more mailing lists