Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp328772rwd; Mon, 12 Jun 2023 14:18:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6MenjEAdGKs0uRpUebek0KkXe9pxJGS6DMmXKVmgwuzYsW912LL4SeIim5PDtdTYjEqG1C X-Received: by 2002:a17:907:1626:b0:977:95f4:5cca with SMTP id hb38-20020a170907162600b0097795f45ccamr10238009ejc.54.1686604735763; Mon, 12 Jun 2023 14:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686604735; cv=none; d=google.com; s=arc-20160816; b=DG4OrVXbvqH0uLOHq8B5BPErCyACniMrj0cmZzKvJ6E+7zpn+MUsCuWZjsyCiwZEnH mm4uyAN+3foe+VsEHFkcm1+j+XYf9UyWWrO1au9nkbBx6HUD7qWgUWXNviQCG+q1Pl+i nxL18VGVa62X6tZ/4CBET3dpIWS+DOmll38/MZIIzEnD3V4bJYIumk5axSPvJabXY/oS 7zBccVQySmZckh9Elogq6KxTFFfehsmndlEjtTQlKzL2tzKMzoOkMQLJ2i59DOfUAsAe hMR56rH3A4wW/n+KQDSs27eLN8ukg5okZhJ75b4ELWlUbB4hL8AraSJ3VyWtWZy4HlLe 7PGw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VuuEyDUxjG5axbLckc0GmsO3MVsKccJZbyk7IQckL7s=; b=K/Pkfs1FAALSTV5tkJc9vkbUdWoB2e52I0jxse/FjfyLfHMzMHxH9ND1Y9wQgjQaCF F+HvyXJy1sRfnh+rsVvd6YVqky2V6+HA352AUtF37xLxP/pMGImOrDpTXSOEkuqistwM n3PWuEYob7f0KBTVuPcuMOYgmOILKyfCW9CUXOJGScWuOYQS+TMsf3imLbD/arVVBB32 haj+0mmP7upds6rGSCQ9EE0nf6T4ohUeR/cXFUF7QCYJwn0W2iwTHlVHhNHdJL3lQdTj oTMEYYy8r8XadHOmSWygQvlqho+uJ5mKqlawbnip0dADL++Be3DobK/dEOVazYzpJ6dE I1AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ixa3VUIP; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v23-20020a17090690d700b0096f8c5b1279si6615631ejw.313.2023.06.12.14.18.31; Mon, 12 Jun 2023 14:18:55 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ixa3VUIP; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238609AbjFLUvp (ORCPT + 99 others); Mon, 12 Jun 2023 16:51:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237707AbjFLUt1 (ORCPT ); Mon, 12 Jun 2023 16:49:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E91A81BDB for ; Mon, 12 Jun 2023 13:47:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0C0F462F29 for ; Mon, 12 Jun 2023 20:45:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 765A9C43335; Mon, 12 Jun 2023 20:45:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686602717; bh=Evs3XQM2ptmnQVe5RZ3I1FeVEzlmruXYwu3iSmSz9lg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ixa3VUIP4/MWYPGOP9kEqnHyLPqFhnHm/9+xZofBjXuUTnfR1pB+oJ0gyij4vtoZg eMKZ9pmrD9GXtfwY8aUWURwdBrqwnM5axbQBV7jeGZdUtotgbCnSazSnwWQFIac0Zf ol7hDyD+eX6jpJphumP6D25tgCWMtJ9wXDs6y9DCjjCZ7IvvQE5HeIz1xpc0CxFa3O GZaiS2lmOrfxBFVpEW/GZV/3ADTlFYBh22LfQcZB9l42fjGxdLldprrDtHnxPHEzM6 uuCRleCOpFB4sCZagzDNcey7pxCnODSmcKkqjPDDLEJFPSXpaQaZ6quL1BdDAhD93Q ppNY/zSDYRzeg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 2B562CE09E7; Mon, 12 Jun 2023 13:45:16 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: gwml@vger.gnuweeb.org, kernel-team@meta.com, w@lwt.eu, Willy Tarreau , "Paul E . McKenney" Subject: [PATCH v2 nolibc 52/53] selftests/nolibc: also count skipped and failed tests in output Date: Mon, 12 Jun 2023 13:45:13 -0700 Message-Id: <20230612204514.292087-52-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <8b757cc0-3719-4e63-a755-9710384137bc@paulmck-laptop> References: <8b757cc0-3719-4e63-a755-9710384137bc@paulmck-laptop> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,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 From: Willy Tarreau Right now skipped and failed test counts are not reported, and a few times already we missed skipped ones that ought not to. Let's now count each category and continue to invite the user to check the report file when skipped+fail > 0. E.g: $ make run-user (...) CC nolibc-test 136 test(s) passed, 2 skipped, 0 failed. See all results in .../run.out Note that it's important to be careful about the trailing \r on the qemu output (thanks Zhangjin for noticing). Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney --- tools/testing/selftests/nolibc/Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 44088535682e..4a3a105e1fdf 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -130,7 +130,10 @@ libc-test: nolibc-test.c # qemu user-land test run-user: nolibc-test $(Q)qemu-$(QEMU_ARCH) ./nolibc-test > "$(CURDIR)/run.out" || : - $(Q)grep -w FAIL "$(CURDIR)/run.out" && echo "See all results in $(CURDIR)/run.out" || echo "$$(grep -c ^[0-9].*OK $(CURDIR)/run.out) test(s) passed." + $(Q)awk '/\[OK\][\r]*$$/{p++} /\[FAIL\][\r]*$$/{f++} /\[SKIPPED\][\r]*$$/{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 initramfs: nolibc-test $(QUIET_MKDIR)mkdir -p initramfs @@ -146,12 +149,18 @@ kernel: initramfs # run the tests after building the kernel run: kernel $(Q)qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(srctree)/$(IMAGE)" -serial stdio $(QEMU_ARGS) > "$(CURDIR)/run.out" - $(Q)grep -w FAIL "$(CURDIR)/run.out" && echo "See all results in $(CURDIR)/run.out" || echo "$$(grep -c ^[0-9].*OK $(CURDIR)/run.out) test(s) passed." + $(Q)awk '/\[OK\][\r]*$$/{p++} /\[FAIL\][\r]*$$/{f++} /\[SKIPPED\][\r]*$$/{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 # re-run the tests from an existing kernel rerun: $(Q)qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(srctree)/$(IMAGE)" -serial stdio $(QEMU_ARGS) > "$(CURDIR)/run.out" - $(Q)grep -w FAIL "$(CURDIR)/run.out" && echo "See all results in $(CURDIR)/run.out" || echo "$$(grep -c ^[0-9].*OK $(CURDIR)/run.out) test(s) passed." + $(Q)awk '/\[OK\][\r]*$$/{p++} /\[FAIL\][\r]*$$/{f++} /\[SKIPPED\][\r]*$$/{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 clean: $(call QUIET_CLEAN, sysroot) -- 2.40.1