Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5130361rwd; Sun, 4 Jun 2023 21:36:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5o/w/Ds3DpVF/LIyMoIzMXveZUdv54jjX5035VEDTQE9+d869dS08Gbk3pRcHZSx93l4c1 X-Received: by 2002:a05:6808:911:b0:39a:ca93:53dc with SMTP id w17-20020a056808091100b0039aca9353dcmr406599oih.24.1685939773670; Sun, 04 Jun 2023 21:36:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685939773; cv=none; d=google.com; s=arc-20160816; b=uwuaC2NA5pZGJs0aoA9H6U1JZlKcoxOdwaDirs2YfJ5+uOffHFKSAE1aM1IJq42uJy 61FHV992coWF5LMOFBhQrXaCC0s6vGD2LGwdwTGJO3mFLrheUiBCC0KmQ5cSSxhVh0Av kYFHf4fY3DqjsKTErXqC7Gl2ghvplBD0LxYYAfmvoxe2AL9XmBHR3DsUf1k7372TkiIV fEPqtrCBgTvVm8rpa4RedxqvmcDLLlnpnt9ClB0Eygwa0uTrfyvOV+qikRGhw8/WwnzL cGeVfScf8lepBl3cEql0B97RMj+uMGOULdVEAkXKS1ZPuR3pM4BfTisVzhr3pjvjca/k mULg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=dCZ6BRDwZzpZB/1Jmg8Vd2dyCSLjUIEDD0Km46f08i0=; b=DgOSy8xg7xpUamnc52rO2G3HRDKWNWqVxl5dwGJk5TKyXE/BkWSz47jW1frqTAgYe4 QgC9UK4ZPoPI1lXjZtV12oyUQd9n0PLT815g1jHMfsvFHWw8HgzjG4xGKrg/zJDUrAnw 7TJVh963r54lsxnYaiKVxyZleh2ZbblVgAwvlWFrm4HHY+qwbzmDoGDAgVeQGNg/Lyke if7b8l71UgoFbRU36AkNjvqGRy+pCvmaDfVNPn9qek9A0yY5P+HJ2zgWCmaSpDp5rRh+ oOECOn78SrCz6XXLgyoifS8jP2btx6nzjX3Kv3hGe2Kezr6QkP4F3sga0lLMs7rMuUOl ZcZA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cx3-20020a17090afd8300b002586dbee167si4951354pjb.170.2023.06.04.21.35.58; Sun, 04 Jun 2023 21:36:13 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232606AbjFEESl (ORCPT + 99 others); Mon, 5 Jun 2023 00:18:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231243AbjFEESk (ORCPT ); Mon, 5 Jun 2023 00:18:40 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 553D5CA; Sun, 4 Jun 2023 21:18:38 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 3554IMKL005432; Mon, 5 Jun 2023 06:18:22 +0200 Date: Mon, 5 Jun 2023 06:18:22 +0200 From: Willy Tarreau To: Zhangjin Wu Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, thomas@t-8ch.de Subject: Re: [PATCH 1/4] selftests/nolibc: add a test-report target Message-ID: References: <291c5437db94057a3b045a6f036b02658380b05b.1685936428.git.falcon@tinylab.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <291c5437db94057a3b045a6f036b02658380b05b.1685936428.git.falcon@tinylab.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 05, 2023 at 11:48:52AM +0800, Zhangjin Wu wrote: > A standalone test-report target is added to let the run, run-user and > rerun targets share them. > > Signed-off-by: Zhangjin Wu > --- > tools/testing/selftests/nolibc/Makefile | 26 ++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile > index be4159837494..8149ace2938a 100644 > --- a/tools/testing/selftests/nolibc/Makefile > +++ b/tools/testing/selftests/nolibc/Makefile > @@ -127,14 +127,18 @@ nolibc-test: nolibc-test.c sysroot/$(ARCH)/include > libc-test: nolibc-test.c > $(QUIET_CC)$(CC) -o $@ $< > > -# qemu user-land test > -run-user: nolibc-test > - $(Q)qemu-$(QEMU_ARCH) ./nolibc-test > "$(CURDIR)/run.out" || : > +test-report: > $(Q)awk '/\[OK\]$$/{p++} /\[FAIL\]$$/{f++} /\[SKIPPED\]$$/{s++} \ > END{ printf("%d test(s) passed, %d skipped, %d failed.", p, s, f); \ > if (s+f > 0) printf(" See all results in %s\n", ARGV[1]); else print; }' \ > $(CURDIR)/run.out > > +# qemu user-land test > +_run-user: nolibc-test > + $(Q)qemu-$(QEMU_ARCH) ./nolibc-test > "$(CURDIR)/run.out" || : > + > +run-user: _run-user test-report > + This will not reliably work, there's no ordering here, nothing guarantees that test-report will run *after* _run-user (e.g. make -j). Another approach is needed if you want to factor this, but in general creating sequences in makefiles is difficult and often more painful than having 3 times the same 3 lines. Willy