From d3013035494f047c4c1b21c5ddacbf564b2e4a38 Mon Sep 17 00:00:00 2001 From: Richard Earnshaw Date: Sat, 21 Apr 2007 19:01:20 +0000 Subject: [PATCH] * binutils-all/readelf.exp (regexp_diff): Delete. --- binutils/testsuite/ChangeLog | 4 + binutils/testsuite/binutils-all/readelf.exp | 102 -------------------- 2 files changed, 4 insertions(+), 102 deletions(-) diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog index f2970ba97ed..3dfd768c5aa 100644 --- a/binutils/testsuite/ChangeLog +++ b/binutils/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2007-04-21 Richard Earnshaw + + * binutils-all/readelf.exp (regexp_diff): Delete. + 2007-04-20 Richard Earnshaw * binutils-all/arm/thumb2-cond.s: Allow for tab expansion by the pty. diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp index cbc54e4f7be..814ae7caa56 100644 --- a/binutils/testsuite/binutils-all/readelf.exp +++ b/binutils/testsuite/binutils-all/readelf.exp @@ -31,108 +31,6 @@ proc file_contents { filename } { return $contents } -# regexp_diff, based on simple_diff taken from ld test suite -# compares two files line-by-line -# file1 contains strings, file2 contains regexps and #-comments -# blank lines are ignored in either file -# returns non-zero if differences exist -# -proc regexp_diff { file_1 file_2 } { - - set eof -1 - set end_1 0 - set end_2 0 - set differences 0 - set diff_pass 0 - - if [file exists $file_1] then { - set file_a [open $file_1 r] - } else { - warning "$file_1 doesn't exist" - return 1 - } - - if [file exists $file_2] then { - set file_b [open $file_2 r] - } else { - fail "$file_2 doesn't exist" - close $file_a - return 1 - } - - verbose " Regexp-diff'ing: $file_1 $file_2" 2 - - while { 1 } { - set line_a "" - set line_b "" - while { [string length $line_a] == 0 } { - if { [gets $file_a line_a] == $eof } { - set end_1 1 - break - } - } - while { [string length $line_b] == 0 || [string match "#*" $line_b] } { - if [ string match "#pass" $line_b ] { - set end_2 1 - set diff_pass 1 - break - } elseif [ string match "#..." $line_b ] { - if { [gets $file_b line_b] == $eof } { - set end_2 1 - break - } - verbose "looking for \"^$line_b$\"" 3 - while { ![regexp "^$line_b$" "$line_a"] } { - verbose "skipping \"$line_a\"" 3 - if { [gets $file_a line_a] == $eof } { - set end_1 1 - break - } - } - break - } - if { [gets $file_b line_b] == $eof } { - set end_2 1 - break - } - } - - if { $diff_pass } { - break - } elseif { $end_1 && $end_2 } { - break - } elseif { $end_1 } { - send_log "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1\n" - verbose "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1" 3 - set differences 1 - break - } elseif { $end_2 } { - send_log "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n" - verbose "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n" 3 - set differences 1 - break - } else { - verbose "regexp \"^$line_b$\"\nline \"$line_a\"" 3 - if ![regexp "^$line_b$" "$line_a"] { - send_log "regexp_diff match failure\n" - send_log "regexp \"^$line_b$\"\nline \"$line_a\"\n" - set differences 1 - } - } - } - - if { $differences == 0 && !$diff_pass && [eof $file_a] != [eof $file_b] } { - send_log "$file_1 and $file_2 are different lengths\n" - verbose "$file_1 and $file_2 are different lengths" 3 - set differences 1 - } - - close $file_a - close $file_b - - return $differences -} - # Find out the size by reading the output of the EI_CLASS field. # Similar to the test for readelf -h, but we're just looking for the # EI_CLASS line here. -- 2.30.2