https://gcc.gnu.org/g:8621554d96eb040547588004c830ff8352492937

commit r15-9460-g8621554d96eb040547588004c830ff8352492937
Author: Thomas Schwinge <tschwi...@baylibre.com>
Date:   Sun Apr 13 16:50:37 2025 +0200

    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:
---
 gcc/testsuite/lib/gcc-dg.exp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index eadc1cd90bcb..6dd8fa3fce9c 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]

Reply via email to