This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [generic + mips testsuite patch]: run_dump_test w/ extraoptions
- From: cgd at broadcom dot com
- To: binutils at sources dot redhat dot com
- Date: 20 Dec 2002 18:51:28 -0800
- Subject: Re: [generic + mips testsuite patch]: run_dump_test w/ extraoptions
- References: <yov5fzsuajkg.fsf@broadcom.com><mailpost.1040261036.12216@news-sj1-1>
Nick C. just approved the generic bits of these and I've checked them in.
I'm _almost_ done w/ the mods to the mips-specific changes
... hopefully i'll get that done tonight.
In the mean time, i've checked in the generic bits, included just that
part of the diff below for reference.
cgd
===================================================================
2002-12-20 Chris Demetriou <cgd@broadcom.com>
* lib/gas-defs.exp (run_dump_test): Add a new optional argument,
"extra_options".
Index: lib/gas-defs.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/lib/gas-defs.exp,v
retrieving revision 1.10
diff -u -p -r1.10 gas-defs.exp
--- lib/gas-defs.exp 9 Sep 2002 01:54:45 -0000 1.10
+++ lib/gas-defs.exp 21 Dec 2002 02:47:55 -0000
@@ -183,7 +183,7 @@ proc gas_init { args } {
}
-# run_dump_test FILE
+# run_dump_test FILE (optional:) EXTRA_OPTIONS
#
# Assemble a .s file, then run some utility on it and check the output.
#
@@ -207,6 +207,12 @@ proc gas_init { args } {
# list ends with the first line that doesn't match the above syntax
# (hmm, not great for error detection).
#
+# The optional EXTRA_OPTIONS argument to `run_dump_test' is a list of
+# two-element lists. The first element of each is an option name, and
+# the second additional arguments to be added on to the end of the
+# option list as given in FILE.d. (If omitted, no additional options
+# are added.)
+#
# The interesting options are:
#
# name: TEST-NAME
@@ -247,7 +253,7 @@ proc gas_init { args } {
# regexps in FILE.d. `regexp_diff' is defined later in this file; see
# further comments there.
-proc run_dump_test { name } {
+proc run_dump_test { name {extra_options {}} } {
global subdir srcdir
global OBJDUMP NM AS OBJCOPY READELF
global OBJDUMPFLAGS NMFLAGS ASFLAGS OBJCOPYFLAGS READELFFLAGS
@@ -291,6 +297,22 @@ proc run_dump_test { name } {
return
}
set opts($opt_name) $opt_val
+ }
+
+ foreach i $extra_options {
+ set opt_name [lindex $i 0]
+ set opt_val [lindex $i 1]
+ if ![info exists opts($opt_name)] {
+ perror "unknown option $opt_name given in extra_opts"
+ unresolved $subdir/$name
+ return
+ }
+ # add extra option to end of existing option, adding space
+ # if necessary.
+ if [string length $opts($opt_name)] {
+ append opts($opt_name) " "
+ }
+ append opts($opt_name) $opt_val
}
if {$opts(PROG) != ""} {