This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH RFA] tweak handling of "#..." at end of testsuite files.


right now, in testsuite comparison files (.d), lines of the form:

	#...

can be used to match multiple lines with no well-defined contents,
i.e. if program output contains junk you just don't care about, you
put #... lines into the .d files and the junk is ignored.

#... does _not_ have that effect at the end of a .d file.  There it's
effectively ignored.

I think that's a bug.

Below is a patch to fix it.  Comments?


cgd
====

for binutils/testsuite/ChangeLog:

2001-07-24  Chris Demetriou  <cgd@broadcom.com>

	* binutils-all/readelf.exp (regexp_diff): Allow "#..." at
	the end of the comparison file to match all lines at the
	end of the dump file.


for gas/testsuite/ChangeLog:

2001-07-24  Chris Demetriou  <cgd@broadcom.com>

	* lib/gas-defs.exp (regexp_diff): Allow "#..." at the
	end of the comparison file to match all lines at the end
	of the dump file.


Index: binutils/testsuite/binutils-all/readelf.exp
===================================================================
RCS file: /cvs/src/src/binutils/testsuite/binutils-all/readelf.exp,v
retrieving revision 1.6
diff -c -r1.6 readelf.exp
*** readelf.exp	2000/11/03 01:59:12	1.6
--- readelf.exp	2001/07/24 19:41:22
***************
*** 79,84 ****
--- 79,97 ----
  	    } elseif [ string match "#..." $line_b ] {
  		if { [gets $file_b line_b] == $eof } {
  		    set end_2 1
+ 
+ 		    # As the last line of the comparison file,
+ 		    # "#..." means match any additional lines in the
+ 		    # dump output.
+ 		    #
+ 		    # We we have to consume the rest of the input here,
+ 		    # or else the check against EOF near this function's
+ 		    # end will fail.
+ 
+ 		    while { [gets $file_a line_a] != $eof } {
+ 			# do nothing.
+ 		    }
+ 		    set end_1 1
  		    break
  		}
  		verbose "looking for \"^$line_b$\"" 3
Index: gas/testsuite/lib/gas-defs.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/lib/gas-defs.exp,v
retrieving revision 1.4
diff -c -r1.4 gas-defs.exp
*** gas-defs.exp	2000/03/31 18:54:24	1.4
--- gas-defs.exp	2001/07/24 19:41:23
***************
*** 499,504 ****
--- 499,517 ----
  	    } elseif [ string match "#..." $line_b ] {
  		if { [gets $file_b line_b] == $eof } {
  		    set end_2 1
+ 
+ 		    # As the last line of the comparison file,
+ 		    # "#..." means match any additional lines in the
+ 		    # dump output.
+ 		    #
+ 		    # We we have to consume the rest of the input here,
+ 		    # or else the check against EOF near this function's
+ 		    # end will fail.
+ 
+ 		    while { [gets $file_a line_a] != $eof } {
+ 			# do nothing.
+ 		    }
+ 		    set end_1 1
  		    break
  		}
  		verbose "looking for \"^$line_b$\"" 3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]