Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA6FBC636D6 for ; Thu, 9 Feb 2023 16:20:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230235AbjBIQUA (ORCPT ); Thu, 9 Feb 2023 11:20:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbjBIQTy (ORCPT ); Thu, 9 Feb 2023 11:19:54 -0500 Received: from mail-yw1-x1129.google.com (mail-yw1-x1129.google.com [IPv6:2607:f8b0:4864:20::1129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BD4C60BAA for ; Thu, 9 Feb 2023 08:19:48 -0800 (PST) Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-52bdbd30328so31744887b3.8 for ; Thu, 09 Feb 2023 08:19:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GlZRd41K0U+KP9r4brauY7yZjWAhAwpFA59RBThBcPw=; b=eYSaPjytR6e1YtVWU78vCni4OsGr+H50oE8zveFDkE72S3iysIkbXHTC29ydnKhB6N yzp2dvxWGTmrzP08y7IFyUI1wh1Qr3o5lSzxFdwhWxnHRl/ehjqXFLf8nFMhwOZ3Nrm6 YHxzrdzH6e5i+pshM0zBQ8okF7Y3yisMErIxhwGKvYXpfIBuWCy/j9RVPQt+B723ShIr +/Y/5DPghqgzxgcDTTRq+9gnUQOk0otYh5o0w7fobXbQ6ChZ/vk2xMcn9GfapdZFK2S9 WjHZMRp2eBMg2QFhiCZ09O5P+8V88640tiOxHIVTNx6G2Bnw7keMa+tBDtR85LQ2iiW6 tDtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GlZRd41K0U+KP9r4brauY7yZjWAhAwpFA59RBThBcPw=; b=AlQRdH0VijzeGNEdw/Ura/v6vhThTahEPBhel/+f0YPhJILGtTWIEg8OSbKK8dKfoi PslIMc45AS4djNPOYh2Mx+i5+0GUn6OOAx1eBGfGe/khM3gLfeIMlMOVjRkAy0g69icN tl8iwESeV6dWLOXGeEIZaPp/ciAaNbfJ6v6RXoQMNrnBedAK92qJCyJib3kjDn+ezJyG w0fqwhs6Fcoz4N/Bu9awqFbWoDdq5Sf0vIEwNS8xXPAtRDxLPgZ0tgArs+jWpAoSABcJ +hBlcRBH4zDJwoZGU2fkay2C5ZynejiyeP8XGah+7LYaCFmOP+a9L2hUPBCgYxzPUg4v uCNQ== X-Gm-Message-State: AO0yUKXZPoUK5GnlXJOnw0nzgsWr94C2t8AAtmUSE4cUTv8dJ0QDJRWd gbewHue1OyQipuCl9bVKKm2+igxf9nM+kX+aQG8rZw== X-Google-Smtp-Source: AK7set8OqEMq5GVQpATraghSz4T7y8K22eJbquY9L4FPI3bDQymX3ttwp3VTYr/LsrqmNZTNfL9Hby4JVEz8JTeXrSo= X-Received: by 2002:a81:69d5:0:b0:506:8253:3444 with SMTP id e204-20020a8169d5000000b0050682533444mr1180650ywc.436.1675959587431; Thu, 09 Feb 2023 08:19:47 -0800 (PST) MIME-Version: 1.0 References: <20230209085536.1076662-1-guillaume.tucker@collabora.com> In-Reply-To: <20230209085536.1076662-1-guillaume.tucker@collabora.com> From: Guenter Roeck Date: Thu, 9 Feb 2023 08:19:36 -0800 Message-ID: Subject: Re: [PATCH v3] selftests: use printf instead of echo -ne To: Guillaume Tucker Cc: Shuah Khan , Gautam , David Laight , kernel@collabora.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kernelci@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 9, 2023 at 12:55 AM Guillaume Tucker wrote: > > 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" > Suggested-by: David Laight > Fixes: 3297a4df805d ("kselftests: Enable the echo command to print newlines in Makefile") > Fixes: 79c16b1120fe ("selftests: find echo binary to use -ne options") > Signed-off-by: Guillaume Tucker Reviewed-by: Guenter Roeck > --- > > Notes: > v2: use printf insead of $(which echo) > v3: rebase on top of fix with $(which echo) > > tools/testing/selftests/Makefile | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile > index 9619d0f3b2ff..06578963f4f1 100644 > --- a/tools/testing/selftests/Makefile > +++ b/tools/testing/selftests/Makefile > @@ -234,11 +234,10 @@ ifdef INSTALL_PATH > @# While building kselftest-list.text skip also non-existent TARGET dirs: > @# they could be the result of a build failure and should NOT be > @# included in the generated runlist. > - ECHO=`which echo`; \ > 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 > >