From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2152) id BE0AD385841A; Sat, 25 Feb 2023 19:43:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE0AD385841A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677354208; bh=hnAx5kI9ND50y2COhgXgnTKKhq4yLU5C5Tri5Dinny4=; h=From:To:Subject:Date:From; b=pzUzF/NsCIRT8PL6LPENQesIXPsM8bNtoXNn/L4DvM1jr0c4AHbiACjxykiEgbfJv gsUOD8stF3pJb750P77ZIgEshzIOuixRdE94MKeXINItayy+/E2nrHVn7RLbDNgsHO yPLqNeJfi8KxfDpa+LUBpDr++tc1dNloh2z1LSWQ= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Hans-Peter Nilsson To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-6345] testsuite: Don't include multiline patterns in the the pass/fail log X-Act-Checkin: gcc X-Git-Author: Hans-Peter Nilsson X-Git-Refname: refs/heads/master X-Git-Oldrev: 03c60e525bea13c15edd2f64cd582f168fe80bfb X-Git-Newrev: a24b2720de5d888a936c350378ae864b81f1a022 Message-Id: <20230225194328.BE0AD385841A@sourceware.org> Date: Sat, 25 Feb 2023 19:43:28 +0000 (GMT) List-Id: https://gcc.gnu.org/g:a24b2720de5d888a936c350378ae864b81f1a022 commit r13-6345-ga24b2720de5d888a936c350378ae864b81f1a022 Author: Hans-Peter Nilsson Date: Fri Feb 24 18:41:13 2023 +0100 testsuite: Don't include multiline patterns in the the pass/fail log 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-pattern-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 pattern 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 pattern in the pass/fail output. Diff: --- 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 84ba9216642..5eccf2bbebc 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]