LD/testsuite: run_dump_test: Use the intended test name ASAP
authorMaciej W. Rozycki <macro@mips.com>
Mon, 9 Jul 2018 14:50:57 +0000 (15:50 +0100)
committerMaciej W. Rozycki <macro@mips.com>
Mon, 9 Jul 2018 14:50:57 +0000 (15:50 +0100)
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/ChangeLog
ld/testsuite/lib/ld-lib.exp

index fe9724bd6c7def345b6579a21964cd37472a49e7..d7d094c8b2367cf8b640edf1340c20fa3e6da768 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-09  Maciej W. Rozycki  <macro@mips.com>
+
+       * testsuite/lib/ld-lib.exp (run_dump_test): Move the setting of
+       `testname' earlier on and use it for test status reporting.
+
 2018-07-09  Alan Modra  <amodra@gmail.com>
 
        * testsuite/ld-discard/extern.d: Remove m68hc12 xfail.
index cfbefe9028e03598b7e071a1bf27c0bc7f5de76c..9e63e30ddcc3c89bb34c7af315737c4d4d928609 100644 (file)
@@ -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 ""]
This page took 0.028596 seconds and 4 git commands to generate.