Message ID | 20230204135652.336495-1-guillaume.tucker@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1368239wrn; Sat, 4 Feb 2023 06:14:20 -0800 (PST) X-Google-Smtp-Source: AK7set/MVU+rTSvtBGhrpIOg4VtBJsP/A8kZIRd/0rQlN5oq2xYVzRiD6ostpOiNf3zzwVmI5y05 X-Received: by 2002:a17:902:c20c:b0:194:9b4e:1c90 with SMTP id 12-20020a170902c20c00b001949b4e1c90mr13267821pll.57.1675520060690; Sat, 04 Feb 2023 06:14:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675520060; cv=none; d=google.com; s=arc-20160816; b=eM52jxrSkj2SFtBakTJlah2WqBpNOShLPLVYbk5knPX3SKN8AbFox8IExlOKMgQ9K6 IzInghA8VGko5pEBg9/eTtupOqnfUJ+ZY0DCFtngKepCWZApi5A6l+P/3+9ucCXUq+ar Cehr1Xme/RXY5P2hcOFtEf470tgiWh9W91WFHIQrIjNPyXgknZQfQEsSKKWo6oZ+kXnY a1v2FRwSUSMpX1YyfN90R0kh48kjODYd1sm+aBjBTc0T24qH4tYOznFRiTkjnkxt8Ok0 xAaaaRm9ZI+YNsFm/6IFw2XX/Kvpm9efZRH/M3AXNzNsHxxImmpL9lncyxVtgLKjp2DD cuiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=C+vyBtmOQ0UvtjWkPDxC9WQZ7riiGn7ebK01g0ce2E4=; b=P2pxfCjvymhO0ebq7sXsSLN8PpCL9VoJzgk5GTNz03M6RvRZxtXq6Qa+vihGs1TxJM avxIp2PEcWRwyHuEWBa+LNVkVL92R6O+iA9Rb/lh7HrRVG84DUMy2ftAggVbPz3W+AMS cRo0sZkR5U07qCGnvoIpUiSFhEyubu7Z8bnqkyIeWsQqUD6KF45TxIOvm24gsslSXFYV +WQjW+yjgJo8U+xgLyrxwMDQV5hEfIO1j0VrtS9R/MlzF8xUvE2aJt39W8LLReOBwFmV uBBg+HkYV+6eAps2M+zbenbY1mQT+8JierAYLwTWr4naf2IdC+tmBLOe26/URe0kG/PT 54kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=UT1hholw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l5-20020a170903120500b0019612704019si5971436plh.124.2023.02.04.06.14.08; Sat, 04 Feb 2023 06:14:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=UT1hholw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233910AbjBDN44 (ORCPT <rfc822;il.mystafa@gmail.com> + 99 others); Sat, 4 Feb 2023 08:56:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233690AbjBDN4v (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 4 Feb 2023 08:56:51 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C05938673; Sat, 4 Feb 2023 05:56:10 -0800 (PST) Received: from tincan.fosdem.net (unknown [IPv6:2001:67c:1810:f055:f11a:faf6:a821:9f0a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: gtucker) by madras.collabora.co.uk (Postfix) with ESMTPSA id CD3786602BD5; Sat, 4 Feb 2023 13:56:06 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1675518967; bh=kSpeY1jQ+KHNtRVxlbyNW0dIhE+UqvA8UpG4A72vwC4=; h=From:To:Cc:Subject:Date:From; b=UT1hholwJV55eMI6vvLJpuCryw/51RcCoCFuRLtL7pih9Hs2N3PUkHBxV480KgwTa 7SG9svy3XWc7SPRbRAlSfCfxNP1D6TXUlGEv56j+A4DmJ5r1rsoEwOXtuc7mos1nrA tmEuIO1Ve4QDgVP0xQfgoEU/V7VXiJZFr18cCwYDWRAOoWhrlW5KLWE/jaOAnlPpgF 69QNcR1eTzTYP1EvaM1967A0YFCKnC/kVmeYWpgwBQUtVnADaVlnlv5A2BCg0PUozj 7MMfESP1VJtFYpXNVC6NgASS06IJ9NBbc1ptpTsTSzF3FaWgjdD5Xbj0G4p04t1H0u s4aaYhsnGrfNw== From: Guillaume Tucker <guillaume.tucker@collabora.com> To: Shuah Khan <shuah@kernel.org>, Gautam <gautammenghani201@gmail.com>, David Laight <David.Laight@ACULAB.COM> Cc: Guillaume Tucker <guillaume.tucker@collabora.com>, kernel@collabora.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kernelci@lists.linux.dev Subject: [PATCH v2] selftests: use printf instead of echo -ne Date: Sat, 4 Feb 2023 14:56:52 +0100 Message-Id: <20230204135652.336495-1-guillaume.tucker@collabora.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756910122941560532?= X-GMAIL-MSGID: =?utf-8?q?1756910122941560532?= |
Series |
[v2] selftests: use printf instead of echo -ne
|
|
Commit Message
Guillaume Tucker
Feb. 4, 2023, 1:56 p.m. UTC
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@kernelci.org>
Suggested-by: David Laight <David.Laight@ACULAB.COM>
Fixes: 3297a4df805d ("kselftests: Enable the echo command to print newlines in Makefile")
Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
---
Notes:
v2: use printf insead of $(which echo)
tools/testing/selftests/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Sat, Feb 4, 2023 at 5:56 AM Guillaume Tucker <guillaume.tucker@collabora.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@kernelci.org> > Suggested-by: David Laight <David.Laight@ACULAB.COM> > Fixes: 3297a4df805d ("kselftests: Enable the echo command to print newlines in Makefile") > Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com> Reviewed-by: Guenter Roeck <groeck@chromium.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 > >
On 04/02/2023 14:56, Guillaume Tucker 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@kernelci.org> > Suggested-by: David Laight <David.Laight@ACULAB.COM> > Fixes: 3297a4df805d ("kselftests: Enable the echo command to print newlines in Makefile") > Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com> > --- > > Notes: > v2: use printf insead of $(which echo) Oh I see you've already applied the v1 on kselftest/next branch: 79c16b1120fe selftests: find echo binary to use -ne options Do you want me to send this printf fix rebased on top? Thanks, Guillaume
On 2/7/23 01:36, Guillaume Tucker wrote: > On 04/02/2023 14:56, Guillaume Tucker 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@kernelci.org> >> Suggested-by: David Laight <David.Laight@ACULAB.COM> >> Fixes: 3297a4df805d ("kselftests: Enable the echo command to print newlines in Makefile") >> Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com> >> --- >> >> Notes: >> v2: use printf insead of $(which echo) > > Oh I see you've already applied the v1 on kselftest/next branch: > > 79c16b1120fe selftests: find echo binary to use -ne options > > Do you want me to send this printf fix rebased on top? > Yes please. Thank you. thanks, --- Shuah
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;