aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Elliston <bje@gnu.org>2006-05-22 03:37:04 +0000
committerBen Elliston <bje@gnu.org>2006-05-22 03:37:04 +0000
commita7964f9e4ede95deac6e8fe46097864ab81a6ae8 (patch)
tree334c24a5a9e1782245c842daba6f43c3d0fcecb1
parent24ac1d99e898aa63020fbcd1409d62849f1b603a (diff)
* runtest.exp: Use switch, not case.
* lib/framework.exp (clone_output): Likewise. (clear_xfail): Likewise. (clear_kfail): Likewise. (set_warning_threshold): Make warning_threshold global. (get_warning_threshold): Likewise. * lib/libgloss.exp (process_multilib_options): Use switch, not case. * lib/remote.exp (local_exec): Only run global errorInfo once. (standard_upload): Fix error in variable use ($file -> $srcfile). * lib/utils.exp (grep): Use switch, not case. (slay): Fix mismatched bracket.
-rw-r--r--ChangeLog13
-rw-r--r--lib/framework.exp8
-rw-r--r--lib/libgloss.exp2
-rw-r--r--lib/remote.exp7
-rw-r--r--lib/utils.exp4
-rwxr-xr-xruntest.exp2
6 files changed, 25 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index c724304..f600630 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2006-05-22 Ben Elliston <bje@gnu.org>
+ * runtest.exp: Use switch, not case.
+ * lib/framework.exp (clone_output): Likewise.
+ (clear_xfail): Likewise.
+ (clear_kfail): Likewise.
+ (set_warning_threshold): Make warning_threshold global.
+ (get_warning_threshold): Likewise.
+ * lib/libgloss.exp (process_multilib_options): Use switch, not
+ case.
+ * lib/remote.exp (local_exec): Only run global errorInfo once.
+ (standard_upload): Fix error in variable use ($file -> $srcfile).
+ * lib/utils.exp (grep): Use switch, not case.
+ (slay): Fix mismatched bracket.
+
* lib/debugger.exp (watcharray): Use switch, not case.
(watchvar): Likewise.
(bt): Add an explanatory comment.
diff --git a/lib/framework.exp b/lib/framework.exp
index 4a555d6..1a42448 100644
--- a/lib/framework.exp
+++ b/lib/framework.exp
@@ -293,7 +293,7 @@ proc clone_output { message } {
}
regsub "^\[ \t\]*(\[^ \t\]+).*$" "$message" "\\1" firstword
- case "$firstword" in {
+ switch "$firstword" {
{"PASS:" "XFAIL:" "KFAIL:" "UNRESOLVED:" "UNSUPPORTED:" "UNTESTED:"} {
if $all_flag {
send_user "$message\n"
@@ -623,7 +623,7 @@ proc clear_xfail { args } {
set argc [ llength $args ]
for { set i 0 } { $i < $argc } { incr i } {
set sub_arg [ lindex $args $i ]
- case $sub_arg in {
+ switch $sub_arg {
"*-*-*" { # is a configuration triplet
if [istarget $sub_arg] {
set xfail_flag 0
@@ -644,7 +644,7 @@ proc clear_kfail { args } {
set argc [ llength $args ]
for { set i 0 } { $i < $argc } { incr i } {
set sub_arg [ lindex $args $i ]
- case $sub_arg in {
+ switch $sub_arg {
"*-*-*" { # is a configuration triplet
if [istarget $sub_arg] {
set kfail_flag 0
@@ -897,12 +897,14 @@ proc kfail { bugid message } {
# Set warning threshold.
#
proc set_warning_threshold { threshold } {
+ global warning_threshold
set warning_threshold $threshold
}
# Get warning threshold.
#
proc get_warning_threshold { } {
+ global warning_threshold
return $warning_threshold
}
diff --git a/lib/libgloss.exp b/lib/libgloss.exp
index 6ff36b6..2871004 100644
--- a/lib/libgloss.exp
+++ b/lib/libgloss.exp
@@ -759,7 +759,7 @@ proc process_multilib_options { args } {
if { $x == "" } {
continue
}
- case $x in {
+ switch $x {
{ aout } {
set_board_info obj_format "a.out"
}
diff --git a/lib/remote.exp b/lib/remote.exp
index f41919c..b493791 100644
--- a/lib/remote.exp
+++ b/lib/remote.exp
@@ -86,7 +86,8 @@ proc local_exec { commandline inp outp timeout } {
# doesn't assign process groups correctly and we can't reliably kill
# programs that bear children. We can't use tcl's exec because it has
# no way to timeout programs that hang. *sigh*
- #
+
+ global errorInfo
if { "$inp" == "" && "$outp" == "" } {
set id -1
set result [catch "eval spawn \{${commandline}\}" pid]
@@ -126,7 +127,6 @@ proc local_exec { commandline inp outp timeout } {
}
if { $result != 0 } {
- global errorInfo
return [list -1 "open of $commandline $inp $outp failed: $errorInfo"]
}
set pid [pid $id]
@@ -138,7 +138,6 @@ proc local_exec { commandline inp outp timeout } {
verbose "pid is $pid $pgid"
if { $result != 0 || $result2 != 0 } {
# This shouldn't happen.
- global errorInfo
if [info exists errorInfo] {
set foo $errorInfo
} else {
@@ -485,7 +484,7 @@ proc standard_upload { dest srcfile destfile } {
catch {exec chmod u+rw $destfile}
}
if { $result != 0 || $output != "" } {
- perror "remote_upload to $dest of $file to $destfile: $output"
+ perror "remote_upload to $dest of $srcfile to $destfile: $output"
return ""
} else {
return $destfile
diff --git a/lib/utils.exp b/lib/utils.exp
index 70a4081..428a85a 100644
--- a/lib/utils.exp
+++ b/lib/utils.exp
@@ -181,7 +181,7 @@ proc grep { args } {
if [regexp -- "$pattern" $cur_line match] {
if ![string match "" $options] {
foreach opt $options {
- case $opt in {
+ switch $opt {
"line" {
lappend grep_out [concat $i $match]
}
@@ -229,7 +229,7 @@ proc slay { name } {
if ![string match "*expect*slay*" $line] {
if [string match "*$name*" $line] {
set pid [lindex $line 0]
- catch "exec kill -9 $pid]"
+ catch "exec kill -9 $pid"
verbose "Killing $name, pid = $pid\n"
}
}
diff --git a/runtest.exp b/runtest.exp
index 600d67f..492b2b2 100755
--- a/runtest.exp
+++ b/runtest.exp
@@ -699,7 +699,7 @@ if [expr { $build_triplet == "" && $host_triplet == ""} ] {
exit 1
}
catch "exec $config_guess" build_triplet
- case $build_triplet in {
+ switch $build_triplet {
{ "No uname command or uname output not recognized" "Unable to guess system type" } {
verbose "WARNING: Uname output not recognized"
set build_triplet unknown