Message ID | 89f3668f48d01fdac847bdfa085867cb641bad27.1688633188.git.falcon@tinylab.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2422400vqx; Thu, 6 Jul 2023 02:20:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlFxA6H8NyH1WbArFnRo5xPPQ1qcDNbof7+hTDvoo+qGw9ixD7IQZdILd1iF8tj1s8wRi4Gh X-Received: by 2002:a17:90a:8406:b0:261:1141:b70d with SMTP id j6-20020a17090a840600b002611141b70dmr795735pjn.45.1688635253111; Thu, 06 Jul 2023 02:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688635253; cv=none; d=google.com; s=arc-20160816; b=x7xaBS4yqHUN79A8RJimRUZGnJ3LKeoetw9730c2vg3bKrFXnB8Cmh2SKQ11rzcR/i flr6ZGmcKZoacGTywa9xMaWXXBsNn6C9Xxr4hzpkZH9eyqlyXikwpQumsgNW8mJPV2JO czVwZ62jHgtqqSc8+JZ2DmqAPoVmK+quC+W9nfYLL9MWF/JX0QdzXYeCHhWM3nByGHVo 0EbDuyYy4JRKt8F7/nWhkP7HoRh/pFhxNgOmK1tSQJK6gFJQt1bw9jgkxBLPPr606dTV QLnk3Ve9cO1xbLCptr/EgveYUh25TqvxwCIPNFb/9Q7Z5dtjUSQCcMdGCvk0qaKbJUwl Ck4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=7zOxsL2zDCsrcei7qD9PemrmLV/4Pogqqyq24xizynE=; fh=kgRNfNE6xRCHBUX3iUlrLhv5pQPglsdZFzOkxo2Fhpc=; b=b82h/F3pgRH6mHTd2yVNOTswi7VHWHNwu5Qhwi9U4k/2ATI6QvtQuEKn8AWxEIk3Qa fa52MI1EHX/NcZgGErtSiUY7t1/MSWtE0VvKekX53/jznpZHusgonp+e3Fhs8lHRdOge 5Wc3NBUXS9cqAfIQaliMiqnV6ceFbJ5LL4/b594a/xb15zXCLgTndemXPZmRB+n6JEdT whmfazQGrdarErsePDxiJPwIA6u5ABtLgZ5as2x82Q7mOq6zr7jGfNst3DkaFn0YYv+h 3Up+f0nGnxJvH0tEph0jfB1JQ4rp5cY62nkv8UiSD+JM5b6d5CS0/JqP4GOoli3aqcKg Enyg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj12-20020a17090b088c00b0025bdaaf0d17si1190652pjb.33.2023.07.06.02.20.38; Thu, 06 Jul 2023 02:20:53 -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 S231902AbjGFJLj (ORCPT <rfc822;hadasmailinglist@gmail.com> + 99 others); Thu, 6 Jul 2023 05:11:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229528AbjGFJLg (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 6 Jul 2023 05:11:36 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65484DB; Thu, 6 Jul 2023 02:11:34 -0700 (PDT) X-QQ-mid: bizesmtp80t1688634683tlze7x0a Received: from linux-lab-host.localdomain ( [116.30.131.119]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 06 Jul 2023 17:11:22 +0800 (CST) X-QQ-SSF: 01200000000000D0W000000A0000000 X-QQ-FEAT: 1U/NVTUyJNRxt0P5nSwuMLL2FGvAjGF+dkHW2Y/MJag7QbharIuxgGfpjt2s2 tlCqyBfgiEUyRn4LJfDaZ2WIOF/af919RI9ktDUb7l5FJVo0Ba8w8GVh/l0tQPj1z6QcN8a 1N6nAaSHLzyR5FDxWP56pQimBWiHZCM40Pdv53FIYwzo4yoL2XIzET4qDKsDpHJkLC2xznd VyJF8LRWJedFUt3y/4XngpJkppYB5OGdHjOyFlOPM0xoP0L69LoBxkdXDX8BGhNHayPRN1v QsORCI1YSIqNj8XwlWWlBJvH/mWzEOwwFGR0nEf7/k0cfZCryyZhNXzqpFfCbz2ggWvb+jM aawzVAHqisghajm85ohCE0jA8/AKUKaymEyIHXIb2Dupvf3fA9LzJnsFKv0Jw== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 1037799378191978913 From: Zhangjin Wu <falcon@tinylab.org> To: w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, thomas@t-8ch.de Subject: [PATCH v1 4/5] selftests/nolibc: report: extrude the test status line Date: Thu, 6 Jul 2023 17:11:17 +0800 Message-Id: <89f3668f48d01fdac847bdfa085867cb641bad27.1688633188.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <cover.1688633188.git.falcon@tinylab.org> References: <cover.1688633188.git.falcon@tinylab.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, 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: <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?1770662398923145339?= X-GMAIL-MSGID: =?utf-8?q?1770662398923145339?= |
Series |
selftests/nolibc: report: print test status
|
|
Commit Message
Zhangjin Wu
July 6, 2023, 9:11 a.m. UTC
two newlines are added around the test summary line to extrude the test
status.
Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
---
tools/testing/selftests/nolibc/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Thu, Jul 06, 2023 at 05:11:17PM +0800, Zhangjin Wu wrote: > two newlines are added around the test summary line to extrude the test > status. But then we're back to making it annoying to check, having to figure if we need to grep -A or grep -B etc. With grep 'status:' we would get a synthetic status and the counters together. Why do you think it's not convenient ? Or am I the only one considering it useful to just run grep "status:" on all output files and figure a global status at once ? Willy
Hi, Willy > On Thu, Jul 06, 2023 at 05:11:17PM +0800, Zhangjin Wu wrote: > > two newlines are added around the test summary line to extrude the test > > status. > > But then we're back to making it annoying to check, having to figure > if we need to grep -A or grep -B etc. With grep 'status:' we would get > a synthetic status and the counters together. Why do you think it's > not convenient ? Or am I the only one considering it useful to just > run grep "status:" on all output files and figure a global status at > once ? Sorry, Willy, my commit message may mislead you a little. The newlines are added around the whole test summary line (with the status info), not only around the 'status info' ;-) An example is added in our cover-letter (use '%3d' instead of '%03d' here): ... <-- newline here --> 138 test(s): 135 passed, 2 skipped, 1 failed => status: failure <-- newline here --> See all results in /labs/linux-lab/src/linux-stable/tools/testing/selftests/nolibc/run.out Or: ... <-- newline here --> 137 test(s): 134 passed, 3 skipped, 0 failed => status: warning <-- newline here --> See all results in /labs/linux-lab/src/linux-stable/tools/testing/selftests/nolibc/run.out It is not for status grep, it is for developers to easily see the whole summary line at a glance (I should add this in the commit message), especially when we run tests for lots of architectures one by one automatically, during the tests running, these newlines may help us to see the status at a glance. And further, if not consider pure-text, the colors may be more helpful, for example, red for failed/failure, yellow for skipped/warning, green for passed/success, for example: $ echo | awk 'END{printf("138 test(s): \033[32m135\033[0m passed, \033[33m 2\033[0m skipped, \033[31m 1\033[0m failed => status: \033[31mfailure\033[0m\n");}' 138 test(s): 135 passed, 2 skipped, 1 failed => status: failure But as we can see, the color control code is not readable and it may break the simple "status: failure" grep, we should use something like "status: .*failure" ;-) It is possible to filter out the color info in the last run.out and only reserve the colors info in the console. $ cat run.tmp.out | sed 's/\x1b\[[0-9;]*m//g' | col -bp > run.out As a summary, the "status info grep" you proposed is very helpful to summarize all of the tests after the testing finish, I do like it: $ grep "status: " /path/to/all/run.out 138 test(s): 135 passed, 2 skipped, 1 failed => status: failure 137 test(s): 134 passed, 3 skipped, 0 failed => status: warning And these newlines (and even further with colors) are added to help developers to see what happens during the tests running at a glance. Thanks, Zhangjin > > Willy
Hi Zhangjin, On Mon, Jul 10, 2023 at 03:26:52AM +0800, Zhangjin Wu wrote: > > On Thu, Jul 06, 2023 at 05:11:17PM +0800, Zhangjin Wu wrote: > > > two newlines are added around the test summary line to extrude the test > > > status. > > > > But then we're back to making it annoying to check, having to figure > > if we need to grep -A or grep -B etc. With grep 'status:' we would get > > a synthetic status and the counters together. Why do you think it's > > not convenient ? Or am I the only one considering it useful to just > > run grep "status:" on all output files and figure a global status at > > once ? > > Sorry, Willy, my commit message may mislead you a little. > > The newlines are added around the whole test summary line (with the > status info), not only around the 'status info' ;-) Ah OK, thanks for clarifying this! > It is not for status grep, it is for developers to easily see the whole > summary line at a glance I understand but both work hand-in-hand, as every time you'll perform a slight change, you'll necessarily rerun the whole series on all archs to confirm, which is why I'm particularly annoying about the ability to grep! > And further, if not consider pure-text, the colors may be more helpful, > for example, red for failed/failure, yellow for skipped/warning, green > for passed/success, for example: > > $ echo | awk 'END{printf("138 test(s): \033[32m135\033[0m passed, \033[33m 2\033[0m skipped, \033[31m 1\033[0m failed => status: \033[31mfailure\033[0m\n");}' > 138 test(s): 135 passed, 2 skipped, 1 failed => status: failure > > But as we can see, the color control code is not readable and it may > break the simple "status: failure" grep, we should use something like > "status: .*failure" ;-) Colors may only be used when stdout is a terminal, and still, some might find it annonying (for example some distros use unreadably dark colors that were apparently never tested over a black background, forcing users to highlight the text by selecting it with the mouse to read it). Better not start to play with this IMO, that's not really needed and may be more annoying to some than helpful to most. Thanks, Willy
diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 2c53bf41967b..10e9e5c1bdd0 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -85,9 +85,9 @@ CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 \ LDFLAGS := -s REPORT ?= awk '/\[OK\][\r]*$$/{p++} /\[FAIL\][\r]*$$/{f++;print} /\[SKIPPED\][\r]*$$/{s++} \ - END{ printf("%03d test(s): %03d passed, %03d skipped, %03d failed => status: ", p+s+f, p, s, f); \ + END{ printf("\n%03d test(s): %03d passed, %03d skipped, %03d failed => status: ", p+s+f, p, s, f); \ if (f) printf("failure\n"); else if (s) printf("warning\n"); else printf("success\n");; \ - printf("See all results in %s\n", ARGV[1]); }' + printf("\nSee all results in %s\n", ARGV[1]); }' help: @echo "Supported targets under selftests/nolibc:"