aboutsummaryrefslogtreecommitdiff
path: root/runtest.exp
diff options
context:
space:
mode:
authorJacob Bachmeyer <jcb@gnu.org>2023-11-07 21:08:04 -0600
committerJacob Bachmeyer <jcb@gnu.org>2023-11-07 21:08:04 -0600
commita877b418a00dcc3c5b4d7584e0d85949c843c4ed (patch)
tree47bb502fdce45ccff915c27346e97e2c071cd3e9 /runtest.exp
parentc298959ef991b389b64a825f70094738c6a48780 (diff)
downloaddejagnu-a877b418a00dcc3c5b4d7584e0d85949c843c4ed.zip
dejagnu-a877b418a00dcc3c5b4d7584e0d85949c843c4ed.tar.gz
dejagnu-a877b418a00dcc3c5b4d7584e0d85949c843c4ed.tar.bz2
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.
Diffstat (limited to 'runtest.exp')
-rw-r--r--runtest.exp10
1 files changed, 8 insertions, 2 deletions
diff --git a/runtest.exp b/runtest.exp
index 84c7e28..078259a 100644
--- a/runtest.exp
+++ b/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
}