This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 1/2] LD/testsuite: run_dump_test: Use the intended test name ASAP
- From: "Maciej W. Rozycki" <macro at mips dot com>
- To: <binutils at sourceware dot org>
- Date: Thu, 5 Jul 2018 21:17:15 +0100
- Subject: [PATCH 1/2] LD/testsuite: run_dump_test: Use the intended test name ASAP
- References: <alpine.DEB.2.00.1807052023560.22261@tp.orcam.me.uk>
Bring the LD implementation of `run_dump_test' in line with its binutils
and GAS counterparts and use the intended test name, from the `name' tag
if set, for test status reporting as soon as it is available.
ld/
* testsuite/lib/ld-lib.exp (run_dump_test): Move the setting of
`testname' earlier on and use it for test status reporting.
---
ld/testsuite/lib/ld-lib.exp | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
binutils-ld-test-run-dump-test-name.diff
Index: binutils/ld/testsuite/lib/ld-lib.exp
===================================================================
--- binutils.orig/ld/testsuite/lib/ld-lib.exp 2018-07-04 00:29:42.000000000 +0100
+++ binutils/ld/testsuite/lib/ld-lib.exp 2018-07-04 00:34:10.876852850 +0100
@@ -746,6 +746,12 @@ proc run_dump_test { name {extra_options
[big_or_little_endian] opts($opt)
}
+ if { $opts(name) == "" } {
+ set testname "$subdir/$name"
+ } else {
+ set testname $opts(name)
+ }
+
# Decide early whether we should run the test for this target.
if { [llength $opts(target)] > 0 } {
set targmatch 0
@@ -782,7 +788,7 @@ proc run_dump_test { name {extra_options
readelf { set program readelf }
default
{ perror "unrecognized program option $opts(PROG) in $file.d"
- unresolved $subdir/$name
+ unresolved $testname
return }
}
} else {
@@ -791,7 +797,7 @@ proc run_dump_test { name {extra_options
if {$opts($p) != ""} {
if {$program != ""} {
perror "ambiguous dump program in $file.d"
- unresolved $subdir/$name
+ unresolved $testname
return
} else {
set program $p
@@ -806,17 +812,11 @@ proc run_dump_test { name {extra_options
&& $opts(error) == "" \
&& $opts(error_output) == "" } {
perror "dump program unspecified in $file.d"
- unresolved $subdir/$name
+ unresolved $testname
return
}
}
- if { $opts(name) == "" } {
- set testname "$subdir/$name"
- } else {
- set testname $opts(name)
- }
-
if { $opts(source) == "" } {
set sourcefiles [list ${file}.s]
set asflags [list ""]