Browse Source

Fix tests that attempt to determine if target_alias has been set

The problem with using [info exists target_alias] is that target_alias
is unconditionally initialized to the empty string and therefore always
exists.
master
Jacob Bachmeyer 3 years ago
parent
commit
a877b418a0
  1. 8
      ChangeLog
  2. 10
      runtest.exp

8
ChangeLog

@ -1,3 +1,11 @@
2023-11-07 Jacob Bachmeyer <jcb@gnu.org>
PR66984
* runtest.exp: Change tests for [info exists target_alias] to
instead test for the empty string, to which target_alias is
unconditionally initialized at early startup.
2023-04-20 Jacob Bachmeyer <jcb@gnu.org>
PR62982

10
runtest.exp

@ -233,7 +233,7 @@ proc transform { name } {
if {[target_info exists target_install]} {
set target_install [target_info target_install]
}
if {[info exists target_alias]} {
if {$target_alias ne ""} {
set tmp $target_alias-$name
} elseif {[info exists target_install]} {
if { [lsearch -exact $target_install $target_alias] >= 0 } {
@ -242,6 +242,12 @@ proc transform { name } {
set tmp "[lindex $target_install 0]-$name"
}
}
# There appears to be a possibility for tmp to be unset at this
# point, which will cause a Tcl error, but this can only occur if
# the init files invoke transform prior to defining target_alias,
# since the target_alias will be defaulted to the value of
# target_triplet before tests are run. If target_triplet is also
# empty, this point will not be reached; see test above.
verbose "Transforming $name to $tmp"
return $tmp
}
@ -890,7 +896,7 @@ unset arg_target_triplet
#
# Default target_alias to target_triplet.
#
if {![info exists target_alias]} {
if {$target_alias eq ""} {
set target_alias $target_triplet
}

Loading…
Cancel
Save