From patchwork Mon Jun 5 03:48:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 13266884 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 85B7AC7EE2C for ; Mon, 5 Jun 2023 03:49:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WWO5tfwfEGs+Uji8rbnOiZ+sE3K2NA+07SjjqEX2MEg=; b=0BswhZ/tk4d8xz epDgcFODvRzm0mJmieiDLFzHp2NM0wqkrfhigJ7n2AgXefhQolf5CW5EOxsfSjLg3r3cCc/v/Z6ZP QDEb4GX6RxZkiQ9OFXkqgN5+trtSmSsBqeZQR00zxhMME+cwicteERulBUXBFeJKit1f3sGib6Vr8 pIBYui8yJI/yDsZT+a10fuWVYRfO08XwjtpBBen8ux34x/Kds4+UoxXiNki9aFiLhDYgDuTWnc5zt 3ctzlcTTkRub/bNvOT9E378IOY6hpRMnn1ybkJ6WAaF2sZu2K7Be2ebB+bdGFJ5zpkIRVYxGl81LB RrENlX+XStOVLcn1zMQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q61DU-00DyN2-28; Mon, 05 Jun 2023 03:49:12 +0000 Received: from bg4.exmail.qq.com ([43.155.67.158]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q61DS-00DyME-1i for linux-riscv@lists.infradead.org; Mon, 05 Jun 2023 03:49:12 +0000 X-QQ-mid: bizesmtp81t1685936936tm3qiisk Received: from linux-lab-host.localdomain ( [61.141.77.49]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 05 Jun 2023 11:48:55 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: PS/N6jJLnDbUhcG1tckp2UkFkb6Y4PEy7Kf4nOh/3d2cGqfkeUq0q6+sKvs5r 4d/2AhXp1+1Ke3XxAEpTe4xrbrIDxn6kk4nhbiHJNnZVr+RNd9/wfD9i5Gg/NvF44ptXKAf M7/nom8UB9c7Sel4L85G5RjmPuXwka10IPIQeZ37y7u2Hfk3Fk8yZIkoCkz89r30XOFk/fQ CboWKF/ON91qEsDHmEaJpy/YHJKw9vefCoivanIsUcYrZLxS/VnW/4VO3ap36W8i7vIuPGu FB4ZLSuv3PsjBuf8cs71QZ8o+IgsJDPqeRbQcHEy7NqFxHl7oEiwZosr8XuNoHHE3ODeXFC p/s1Jq3A6+bNSgZAzUcm+k/W2k64vxSIgijB2BtMEaXGClTr/tVw2Vy2qGk5A== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 17656311057048569074 From: Zhangjin Wu To: w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, thomas@t-8ch.de Subject: [PATCH 1/4] selftests/nolibc: add a test-report target Date: Mon, 5 Jun 2023 11:48:52 +0800 Message-Id: <291c5437db94057a3b045a6f036b02658380b05b.1685936428.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz3a-3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230604_204910_871915_8A0CB8D1 X-CRM114-Status: UNSURE ( 7.27 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 + initramfs: nolibc-test $(QUIET_MKDIR)mkdir -p initramfs $(call QUIET_INSTALL, initramfs/init) @@ -147,20 +151,16 @@ kernel: initramfs $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME) CONFIG_INITRAMFS_SOURCE=$(CURDIR)/initramfs # run the tests after building the kernel -run: kernel +_run: kernel $(Q)qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(srctree)/$(IMAGE)" -serial stdio $(QEMU_ARGS) > "$(CURDIR)/run.out" - $(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 + +run: _run test-report # re-run the tests from an existing kernel -rerun: +_rerun: $(Q)qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(srctree)/$(IMAGE)" -serial stdio $(QEMU_ARGS) > "$(CURDIR)/run.out" - $(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 + +rerun: _rerun test-report clean: $(call QUIET_CLEAN, sysroot) From patchwork Mon Jun 5 03:50:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 13266889 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DAB10C7EE2C for ; Mon, 5 Jun 2023 03:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DMFXTcnpT3LR/VFbMYQCcPjuafWYuYPw0uwZOzELv6A=; b=1KSRg9AEjppuOg y/0OwsaElegHgbcx5pM2MWUXj5EFeSjuUgNbtusdqEaEPoQ3a4tvMF11Wko2yRQ7OZM5PAchNgyh/ /ihO+2dQzF8hbPe0MAh8rVlcc/XQ+4HmlkNJaAcVnlh4sP3y8lToI2s+0sJr5H9r6Yq6EVRWuVuJb zFrlUxy/SBSnBrOh3D6ZQwigkziSylQfMVjvBnoFx3k0XV1nmnx7KIP5zvSZUA+nFaD4i0Rpip6/h OrpJSheTmEWJ8jFhqA7B/QsWAHAnxt4D0T5sGye54kkeDtdXcQuJS3b1NKcvNdAq9qRbnFalE/p+d ajSQg7F8WsXqD1Yx/evw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q61Kv-00DzXC-1I; Mon, 05 Jun 2023 03:56:53 +0000 Received: from bg4.exmail.qq.com ([43.154.221.58]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q61Kt-00DzVA-0I for linux-riscv@lists.infradead.org; Mon, 05 Jun 2023 03:56:52 +0000 X-QQ-mid: bizesmtp82t1685937396t1aouh5f Received: from linux-lab-host.localdomain ( [61.141.77.49]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 05 Jun 2023 11:56:35 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: lm7sZZPcOdbJD8cVKMiASAi6Ml/t7tG1bkV1nfPLPi2vvHA+K/8f3KsCqtD4h LE7aT9mS730pQq+6dEcXz/fpRaJJRtqKoGlSuiNVsKvopYVg0cchyzAmQN9oq/txeCU22Sd CtnySZNGMOe0xBHD2xeYxw2OQr70b6yN+52l56pzPKka2ALTCEBKeBuW23qLP+UI0C17/ZT FDVh4zmtUmyLVGcrRaHhAefpzv6rSxiSNhLs0n/lIGGT3uPSjid8Wb+hDTXXLloZckxNl7C Xk8INamYkM+Qj5L/j5hdbxmrrK3ixkkfp0o5M+oHUvvv3n5hMAY+4nr40sgBq2pu3rQgU2K dP6IxQmVW1fAi4AhrjN1OKB0FAz02D2lObYwHl7xcncwCU+IL3Csj8V2sYGTTnAA3pKlDul X-QQ-GoodBg: 0 X-BIZMAIL-ID: 9763339930852643474 From: Zhangjin Wu To: w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, thomas@t-8ch.de Subject: [PATCH 2/4] selftests/nolibc: allow run test-report directly Date: Mon, 5 Jun 2023 11:50:04 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz3a-3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230604_205651_434547_E6CDA3D1 X-CRM114-Status: UNSURE ( 7.79 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This allows to re-check the test report via 'make test-report' without the requirement to re-run the dependency targets. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 8149ace2938a..5b0af8d8f5f3 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -128,10 +128,10 @@ libc-test: nolibc-test.c $(QUIET_CC)$(CC) -o $@ $< test-report: - $(Q)awk '/\[OK\]$$/{p++} /\[FAIL\]$$/{f++} /\[SKIPPED\]$$/{s++} \ + $(Q)[ -f $(CURDIR)/run.out ] && 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 + $(CURDIR)/run.out || : # qemu user-land test _run-user: nolibc-test From patchwork Mon Jun 5 03:57:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 13266890 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8A7AEC7EE2C for ; Mon, 5 Jun 2023 03:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=j/6ESjCqAlPW91rHYchgQwybVoZum641XbUcT0/qYRw=; b=UlgnKofEXp8j+c Wt7TZLiJDk3mNogLb+BVwSjSwbXuehN/V7veG3jpg9ovBra751fN+rWz79J6C0hg9iXC8ncWWCC6A i5+fqf+xBFW3o0mkVBxCKpScxEvHHz21BRRRVLzm49VTWM/zxJFHcxCdxt6F+415C+oCGV2fYQJyJ bGgXWw4JZIlrQ84EpDJzlWevEcAhWnT+xx3PrRtmPXw2RYkw2XvGFLGAmnT0WnkfXIw3l42jb2fha yd0XTw4dy3rjbbb+Gi9X4oHMArWMg6pcpFVCUv13hbNeZdU3c2CJKRaTAwGiVAL7PCduEcPvtWhEu CkJDjCZQ8eoL6vvfCWSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q61M9-00Dzii-2z; Mon, 05 Jun 2023 03:58:09 +0000 Received: from bg4.exmail.qq.com ([43.155.67.158]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q61M6-00Dzh0-2r for linux-riscv@lists.infradead.org; Mon, 05 Jun 2023 03:58:08 +0000 X-QQ-mid: bizesmtp89t1685937468tqznavd2 Received: from linux-lab-host.localdomain ( [61.141.77.49]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 05 Jun 2023 11:57:47 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: dKvkn8qoLrGXN8h42NRMms+7urQ9WLIQF9jRVidEDJkV0vebFHsuJOValBm6o C3EIJxwfkS/a6CpLXS6bvhkA8SoIR1mt3nnZIMpbGaF3twWVbG9DPbwawMfrPT12NcT0xVy xxNaUL0PXRcrUQlpm8LPUUvB7Dkgd9ZBgsnt7GRinn9m0wQjnptaR3GWLjyfb5vdEny1J4r F4gXLkQBHKu9v1ynmmr7AROd+QdNG66n1ZBKVVI+JGuyNStZawuednjxkv98BAXHYs3JsvE FrgTtDwUxyzrgkjN9v6YQAGfJyW1gnxEUkatJDGzoncqAoREl4aTkk/RSNL5x9xWOWXNK93 yDz01PwbYdrwhRDrKfO6HDEyPbNya71Pu7D/TIflfmDDAfhUCwlPPoDVdNefg== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 2171116470520406675 From: Zhangjin Wu To: w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, thomas@t-8ch.de Subject: [PATCH 3/4] selftests/nolibc: always print the log file Date: Mon, 5 Jun 2023 11:57:44 +0800 Message-Id: <835e118943d257b7a83066fb4fb77c0e5cf71534.1685936428.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz3a-3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230604_205807_217776_9F5CEB39 X-CRM114-Status: UNSURE ( 9.24 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This allows to check the other issues of the output file manually even when all of them passed. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 5b0af8d8f5f3..518f85c77fe3 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -130,7 +130,7 @@ libc-test: nolibc-test.c test-report: $(Q)[ -f $(CURDIR)/run.out ] && 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; }' \ + printf(" See all results in %s\n", ARGV[1]); }' \ $(CURDIR)/run.out || : # qemu user-land test From patchwork Mon Jun 5 03:58:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 13266891 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B94F7C7EE2C for ; Mon, 5 Jun 2023 03:59:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SzvR8mo9RrvALVoO2BVMeMw2gvtKwGKD/d6cd2TC8as=; b=DPA0+RzNZKdZYu HGKvyphGqcXWJzj85lrNI5ZKCXiq8hbAKWSqJOXu2JE8Fi8RzILerht5Aa1ql4STQdQHYih416TXd hwQ0wEWTGNRBol0upQ6x3QoKi8DWiabrDTkooJcczOF7dqsWuBmtIjfkvGAZiRikLEL6F+bqPlz5G 1RrjCTxCLdL+QfZN9t9IKe8IrM4kuf5A2QDeQXIkLE16EzsZdrXGiduNHFSqx6WUwwGi9sA8gNNlW xvfSckgunWkhtDh7iOC92E2cN1ncGoFbwlozaxGnnICKL23ZWddvUNeqwgto7FBcjPsiD082fRg2u 7VA/3p+qBX+cnNLcsaGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q61No-00E0F5-3D; Mon, 05 Jun 2023 03:59:53 +0000 Received: from bg4.exmail.qq.com ([43.154.221.58]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q61Nm-00E0Dw-27 for linux-riscv@lists.infradead.org; Mon, 05 Jun 2023 03:59:52 +0000 X-QQ-mid: bizesmtp68t1685937578tx69i1ko Received: from linux-lab-host.localdomain ( [61.141.77.49]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 05 Jun 2023 11:59:37 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: lm7sZZPcOdYzjWmXFGgj6E3I64yRDtOeBkKpihw5JkC6Lh5HJLerIyruOvXGE kZaWrOoWRl3kQBx61WfeP9JGjH3DVcuICln3tJb6hodrhPrC4CzBb293lFd6sXzKdXUSkYo fkvOPxW86R2WYemPnw5yHFVCGrS3BXT5m82EELWi4l7NsT1L7/a3d+SgCnA3y7Z5KDgIUzM Lj4owyhk4zremCkMU+87WSmz4hMxzd3fzkDRBRpSbTUgzsPtC7vT3pz4IzKim/SlQr7rYHW 9K3/kzT9fCpGzRik5GAItVGrbM4SqnTp0TF3XyrNqJlcoFgoB5zbOI1CE0Is01X4gJuhpil bAXNTEUPVGbvTyowOFEia/SH6FHOIeTHxV04gii9MpmlGM8W0BVdODaI+JQBQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 185392236661113198 From: Zhangjin Wu To: w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, thomas@t-8ch.de Subject: [PATCH 4/4] selftests/nolibc: fix up test-report for run target Date: Mon, 5 Jun 2023 11:58:56 +0800 Message-Id: <48a994c40ac739a0e20ed7a34f290637e417bb0b.1685936428.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz3a-3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230604_205951_002778_C1256A28 X-CRM114-Status: UNSURE ( 8.84 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org There is a '\r' at the end of every log line when run nolibc-test on qemu-system (make run), add support for this case, otherwise, the test result will like this: 0 test(s) passed, 0 skipped, 0 failed. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 518f85c77fe3..70a27fc41c22 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -128,7 +128,7 @@ libc-test: nolibc-test.c $(QUIET_CC)$(CC) -o $@ $< test-report: - $(Q)[ -f $(CURDIR)/run.out ] && awk '/\[OK\]$$/{p++} /\[FAIL\]$$/{f++} /\[SKIPPED\]$$/{s++} \ + $(Q)[ -f $(CURDIR)/run.out ] && awk '/\[OK\][\r]*$$/{p++} /\[FAIL\][\r]*$$/{f++} /\[SKIPPED\][\r]*$$/{s++} \ END{ printf("%d test(s) passed, %d skipped, %d failed.", p, s, f); \ printf(" See all results in %s\n", ARGV[1]); }' \ $(CURDIR)/run.out || :