aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Bachmeyer <jcb62281@gmail.com>2018-11-22 12:04:10 +1100
committerBen Elliston <bje@gnu.org>2018-11-22 12:04:10 +1100
commit73a138783acb52eb30ad0df731dc390170d803ad (patch)
tree50d2c18a898e630f91018dc459a7387de80425d1
parentffca2d28a3909351b1da633bec179a47ac9280e0 (diff)
downloaddejagnu-73a138783acb52eb30ad0df731dc390170d803ad.zip
dejagnu-73a138783acb52eb30ad0df731dc390170d803ad.tar.gz
dejagnu-73a138783acb52eb30ad0df731dc390170d803ad.tar.bz2
* runtest.exp: Ensure that multipass pass variables are always
restored. Previously, they were only restored if the "Go digging for tests" branch was taken near the end of runtest.exp. This bug was found while splitting a new variable out of some uses of $srcdir when Emacs paren highlighting did not look right. Sure enough, the per-pass variables are set unconditionally, but are only restored if the "Go digging for tests" branch was taken. This patch moves that loop out of an 'else' block and into the same 'foreach' that contains the loop that sets per-pass variables. Signed-off-by: Ben Elliston <bje@gnu.org>
-rw-r--r--ChangeLog6
-rw-r--r--runtest.exp19
2 files changed, 16 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 900ba16..2a05040 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-11-22 Jacob Bachmeyer <jcb62281@gmail.com>
+
+ * runtest.exp: Ensure that multipass pass variables are always
+ restored. Previously, they were only restored if the "Go digging
+ for tests" branch was taken near the end of runtest.exp.
+
2018-11-22 Ben Elliston <bje@gnu.org>
* doc/dejagnu.texi (Customizing DejaGnu): Document error handling
diff --git a/runtest.exp b/runtest.exp
index 6126254..f7d1555 100644
--- a/runtest.exp
+++ b/runtest.exp
@@ -1886,15 +1886,16 @@ foreach current_target $target_list {
}
}
}
- # Restore the variables set by this pass.
- foreach varval $restore {
- if { [llength $varval] > 1 } {
- verbose "Restoring [lindex $varval 0] to [lindex $varval 1]" 4
- set [lindex $varval 0] [lindex $varval 1]
- } else {
- verbose "Restoring [lindex $varval 0] to `unset'" 4
- unset -- [lindex $varval 0]
- }
+ }
+
+ # Restore the variables set by this pass.
+ foreach varval $restore {
+ if { [llength $varval] > 1 } {
+ verbose "Restoring [lindex $varval 0] to [lindex $varval 1]" 4
+ set [lindex $varval 0] [lindex $varval 1]
+ } else {
+ verbose "Restoring [lindex $varval 0] to `unset'" 4
+ unset -- [lindex $varval 0]
}
}
}