From patchwork Fri Feb 24 17:54:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 61408 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1052357wrd; Fri, 24 Feb 2023 09:55:21 -0800 (PST) X-Google-Smtp-Source: AK7set/YlqDN8qKo/ElhQwu5DwyKBtuc4IkAzl7q2fxF/NqqHWEtLx/e6oInVCQxj/uNXTX9bfOh X-Received: by 2002:a05:6402:268e:b0:4ac:b528:5727 with SMTP id w14-20020a056402268e00b004acb5285727mr599241edd.1.1677261320968; Fri, 24 Feb 2023 09:55:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677261320; cv=none; d=google.com; s=arc-20160816; b=DmQP/7twqcUAMF+BwUti293AZ8xSbM5aDkXLOSUjliddzhNGGbDDRqk3HyX1uK8Akp ikEh0f3320bu4R4tPIhdtIsdDCrlzOT8hcAxRHmKSpZ7TWwxkV3J1HEoObysFI2e9cZ2 mkBh6KgEJTbpJ/99uKccZa/y6uzFRk47lK3tDjoegK4Z/AH/U+vvoSeEev/Q1XsgFdV/ v9NzexgwL+SccbWkEJ9BsJEvKTAHPe8zfwMPTQRKMyMcxbb2qw+vhOYD9aP9kY2mw13r VK26O3nQz4+CsyPi20BZwLh8DeVxs7QX/1LfOcJosXlBJH1r7AAO8ya7/QgU0qlCM7f4 U4JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:date:message-id :content-transfer-encoding:mime-version:subject:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=HYW2swfbfyjVGMZyYaQ4i04dvJv3iRSC2KwJsIO6ljQ=; b=WkJumZJtTE3y2mf1Lec0I14x46Nff7hf5Zeo6EcuOv912dcqW/YG3n80Xkcu2D62z7 n2kEZyEVDH7t1N6skJg9vIJDX17O6U9JJPgRytK2V3nRdFjQo/Wbm9slgFBq2AznbGZU R5FSnhpS2ZOf1MFjwjrkQ+PqKbM/TFKWT9c9OgXZ6uTnhsSp7yX4HXNyWynLsmwl7Xi3 L0HYl9nVDWvnIKR17KZNeQ6ZUOAViNk2V10K77F94Qn5dclbtABK2Y1NdnOERZsnFTrA R+pNkQzlMMY/Xis+kP490Tj4OoBG3JiMMXaD3LO+kyr+CUdZHXrDfE72HD/oA2dPqK1K 3+6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=bingCIQH; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id y25-20020aa7ccd9000000b004ad70559a0bsi10450435edt.64.2023.02.24.09.55.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 09:55:20 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=bingCIQH; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0CB8E3854803 for ; Fri, 24 Feb 2023 17:55:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0CB8E3854803 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677261320; bh=HYW2swfbfyjVGMZyYaQ4i04dvJv3iRSC2KwJsIO6ljQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=bingCIQHgkkMzSAfc5j3UOJGkbunLR73F2gyksxOe8CEGJRXrLAv8DDwDUHO9cKSD 3Fj5chV701GedQVqzSGBn00sGo85LUwlQpbqY904m7c5kGFRkp1Do88JbosPeecD3V V8sl+F6PMrU40/UyudlrFhIEhdalW/70PWhMMH7o= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id 4FB053857C45 for ; Fri, 24 Feb 2023 17:54:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4FB053857C45 To: , Subject: [PATCH] testsuite: Don't include multiline regexps in the the pass/fail log MIME-Version: 1.0 Message-ID: <20230224175433.CF5002043D@pchp3.se.axis.com> Date: Fri, 24 Feb 2023 18:54:33 +0100 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758735966847794764?= X-GMAIL-MSGID: =?utf-8?q?1758735966847794764?= Ok to commit? -- >8 -- I see overlong lines in the output when a test fails, for example for a bug exposed for cris-elf and pru-elf in gcc.dg/analyzer/allocation-size-multiline-3.c: Running /x/gcc/testsuite/gcc.dg/analyzer/analyzer.exp ... FAIL: gcc.dg/analyzer/allocation-size-multiline-3.c expected multiline pattern lines 16-25 not found: "\s*int32_t \*ptr = alloca \(99\);[^\n\r]*\n \^~~~~~\n 'test_constant_99': events 1-2[^\n\r]*\n \|[^\n\r]*\n \| int32_t \*ptr = alloca \(99\);[^\n\r]*\n \| \^~~~~~\n \| \|[^\n\r]*\n \| \(1\) allocated 99 bytes here[^\n\r]*\n \| \(2\) assigned to 'int32_t \*' \{aka 'int \*'\} here; 'sizeof \(int32_t \{aka int\}\)' is '4'[^\n\r]*\n \|[^\n\r]*\n" FAIL: gcc.dg/analyzer/allocation-size-multiline-3.c expected multiline pattern lines 34-43 not found: " int32_t \*ptr = alloca \(n \* 2\);[^\n\r]*\n \^~~~~~\n 'test_symbolic': events 1-2[^\n\r]*\n \|[^\n\r]*\n \| int32_t \*ptr = alloca \(n \* 2\);[^\n\r]*\n \| \^~~~~~\n \| \|[^\n\r]*\n \| \(1\) allocated 'n \* 2' bytes here[^\n\r]*\n \| \(2\) assigned to 'int32_t \*' \{aka 'int \*'\} here; 'sizeof \(int32_t \{aka int\}\)' is '4'[^\n\r]*\n \|[^\n\r]*\n" FAIL: gcc.dg/analyzer/allocation-size-multiline-3.c (test for excess errors) That multiline-regexp-quoted-on-a-single-line is redundant when also outputting "lines 16-25" and "lines 34-43". It's also so noisy that it can be mistaken for a testsuite error. If there's a need to inspect it, it can be seen at verbose-level 4, i.e. persons interested in seeing it without editing sources can just add "-v -v -v -v". Let's "prune" the regexp from regular output, instead producing: Running /x/gcc/testsuite/gcc.dg/analyzer/analyzer.exp ... FAIL: gcc.dg/analyzer/allocation-size-multiline-3.c expected multiline pattern lines 16-25 not found FAIL: gcc.dg/analyzer/allocation-size-multiline-3.c expected multiline pattern lines 34-43 not found FAIL: gcc.dg/analyzer/allocation-size-multiline-3.c (test for excess errors) * lib/multiline.exp (handle-multiline-outputs): Don't include the quoted multiline regexp in the pass/fail output. --- gcc/testsuite/lib/multiline.exp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/lib/multiline.exp b/gcc/testsuite/lib/multiline.exp index 84ba9216642e..5eccf2bbebc1 100644 --- a/gcc/testsuite/lib/multiline.exp +++ b/gcc/testsuite/lib/multiline.exp @@ -169,9 +169,9 @@ proc handle-multiline-outputs { text } { # Use "regsub" to attempt to prune the pattern from $text if {[regsub -line $rexp $text "" text]} { # The multiline pattern was pruned. - ${maybe_x}pass "$title was found: \"$escaped_regex\"" + ${maybe_x}pass "$title was found" } else { - ${maybe_x}fail "$title not found: \"$escaped_regex\"" + ${maybe_x}fail "$title not found" } set index [expr $index + 1]