Browse Source

* 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.
origin
Ben Elliston 21 years ago
parent
commit
a7964f9e4e
  1. 13
      ChangeLog
  2. 8
      lib/framework.exp
  3. 2
      lib/libgloss.exp
  4. 7
      lib/remote.exp
  5. 4
      lib/utils.exp
  6. 2
      runtest.exp

13
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.

8
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
}

2
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"
}

7
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

4
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"
}
}

2
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

Loading…
Cancel
Save