From: Thomas Schwinge Date: Sun, 13 Apr 2025 14:50:37 +0000 (+0200) Subject: Polish 'dg-output-file' test logs X-Git-Tag: basepoints/gcc-16~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8621554d96eb040547588004c830ff8352492937;p=thirdparty%2Fgcc.git Polish 'dg-output-file' test logs Per commit r15-8260-g563e6d926d9826d76895086d0c40a29dc90d66e5 "testsuite: Add support for dg-output-file directive", this currently produces test logs as follows: PASS: gcc.dg/dg-output-file-1.c (test for excess errors) PASS: dg-output-file-1-lp64.txt output file test PASS: gcc.dg/dg-output-file-1.c execution test PASS: cobol.dg/group2/COMP-6_arithmetic.cob -O0 (test for excess errors) PASS: COMP-6_arithmetic.out output file test PASS: cobol.dg/group2/COMP-6_arithmetic.cob -O0 execution test PASS: cobol.dg/group2/COMP-6_arithmetic.cob -O1 (test for excess errors) PASS: COMP-6_arithmetic.out output file test PASS: cobol.dg/group2/COMP-6_arithmetic.cob -O1 execution test [Etc.] Notice that the 'PASS: [...] output file test' lines easily produce duplicate test names, or might even produce PASS plus FAIL for the same test names. Make the "output file test" use the same "descriptive name" as the other parts, and get properly sorted with parallel-testing 'contrib/dg-extract-results.sh' processing: PASS: c-c++-common/zero-scratch-regs-leafy-2.c -Wc++-compat (test for excess errors) -PASS: dg-output-file-1-lp64.txt output file test PASS: gcc.dg/20000108-1.c (test for excess errors) [...] PASS: gcc.dg/devnull-dump.c (test for excess errors) PASS: gcc.dg/dg-output-file-1.c (test for excess errors) PASS: gcc.dg/dg-output-file-1.c execution test +PASS: gcc.dg/dg-output-file-1.c output file test PASS: gcc.dg/dg-test-1.c (test for excess errors) ..., and gets de-duplicated test names, for example: PASS: cobol.dg/group2/COMP-6_arithmetic.cob -O0 (test for excess errors) -PASS: COMP-6_arithmetic.out output file test +PASS: cobol.dg/group2/COMP-6_arithmetic.cob -O0 output file test PASS: cobol.dg/group2/COMP-6_arithmetic.cob -O0 execution test PASS: cobol.dg/group2/COMP-6_arithmetic.cob -O1 (test for excess errors) -PASS: COMP-6_arithmetic.out output file test +PASS: cobol.dg/group2/COMP-6_arithmetic.cob -O1 output file test PASS: cobol.dg/group2/COMP-6_arithmetic.cob -O1 execution test [Etc.] (Given that only ever a single 'dg-output-file' directive is active, don't print the output filename.) gcc/testsuite/ * lib/gcc-dg.exp (${tool}_load): Polish 'dg-output-file' test logs. --- diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index eadc1cd90bc..6dd8fa3fce9 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -507,8 +507,7 @@ if { [info procs ${tool}_load] != [list] \ set linenum 1 set outfile [open [lindex ${output-file} 1]] set do_fail 0 - set name [file tail [lindex ${output-file} 1]] - verbose "output-file args is $args program is $program" 1 + set name [testname-for-summary] while { [gets $outfile line] >= 0 } { if { $linenum != 1 } { set c [string index $output $idx]