From d30fc980ac0178eb8a64277c063d518cb691f1d2 Mon Sep 17 00:00:00 2001 From: Jiong Wang Date: Wed, 12 Nov 2014 09:37:01 +0000 Subject: [PATCH] [PATCH][dejagnu] truncate absolute file path into relative for dg-output gcc/testsuite/ * lib/gcc-dg.exp (${tool}_load): Truncate gcc output. * lib/prune.exp (prune_gcc_output): New absolute path to relative path truncation pattern. From-SVN: r217408 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/lib/gcc-dg.exp | 2 ++ gcc/testsuite/lib/prune.exp | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3a0dfed8bfd..1cb9e1cc36f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-11-12 Jiong Wang + + * lib/gcc-dg.exp (${tool}_load): Truncate gcc output. + * lib/prune.exp (prune_gcc_output): New absolute path to relative path + truncation pattern. + 2014-11-12 Andreas Tobler * gcc.target/arm/eabi1.c: Replace arm*-*-*eabi* and arm*-*-symbianelf* diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index a0d1e7ddde9..8168a77a441 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -281,6 +281,8 @@ if { [info procs ${tool}_load] != [list] \ } set result [list $status [lindex $result 1]] } + + set result [list [lindex $result 0] [prune_gcc_output [lindex $result 1]]] return $result } } diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp index 859d25ef801..65028c21190 100644 --- a/gcc/testsuite/lib/prune.exp +++ b/gcc/testsuite/lib/prune.exp @@ -22,6 +22,8 @@ if ![info exists TEST_ALWAYS_FLAGS] { set TEST_ALWAYS_FLAGS "-fno-diagnostics-show-caret -fdiagnostics-color=never $TEST_ALWAYS_FLAGS" proc prune_gcc_output { text } { + global srcdir + #send_user "Before:$text\n" regsub -all "(^|\n)(\[^\n\]*: )?In ((static member |lambda )?function|member|method|(copy )?constructor|destructor|instantiation|substitution|program|subroutine|block-data)\[^\n\]*" $text "" text @@ -66,6 +68,11 @@ proc prune_gcc_output { text } { # Ignore harmless warnings from Xcode 4.0. regsub -all "(^|\n)\[^\n\]*ld: warning: could not create compact unwind for\[^\n\]*" $text "" text + # Truncate absolute file path into relative path. + set topdir "[file dirname [file dirname [file dirname $srcdir]]]" + regsub -all "$srcdir\/" $text "" text + regsub -all "$topdir\/" $text "" text + #send_user "After:$text\n" return $text -- 2.30.2