diff options
author | Ben Elliston <bje@gnu.org> | 2003-08-07 03:42:42 +0000 |
---|---|---|
committer | Ben Elliston <bje@gnu.org> | 2003-08-07 03:42:42 +0000 |
commit | d7b7156075df25716082174f6baf2ac0e163e939 (patch) | |
tree | e2c4f9afdb89cf1e6f082acf7c1a0aae0fd423a8 /config/vxworks.exp | |
parent | 8f0d1b58dbfb8b4e7ad5c14f21d65da05a364200 (diff) | |
download | dejagnu-d7b7156075df25716082174f6baf2ac0e163e939.zip dejagnu-d7b7156075df25716082174f6baf2ac0e163e939.tar.gz dejagnu-d7b7156075df25716082174f6baf2ac0e163e939.tar.bz2 |
Strip trailing semicolons from Tcl source files.
Diffstat (limited to 'config/vxworks.exp')
-rw-r--r-- | config/vxworks.exp | 264 |
1 files changed, 132 insertions, 132 deletions
diff --git a/config/vxworks.exp b/config/vxworks.exp index 81af297..e47d5d8 100644 --- a/config/vxworks.exp +++ b/config/vxworks.exp @@ -25,90 +25,90 @@ # proc ${board}_init { dest } { # This is not the right way to determine the required OS... - global target_os; - set shell_prompt [board_info $dest shell_prompt]; - set do_reboot 0; + global target_os + set shell_prompt [board_info $dest shell_prompt] + set do_reboot 0 - set desired_kernel [board_info $dest "kernel,$target_os"]; + set desired_kernel [board_info $dest "kernel,$target_os"] if { $desired_kernel == "" } { - vxworks_final_init $dest; + vxworks_final_init $dest # Nothing to see here, nothing to do. Move along. - return; + return } - remote_raw_open $dest raw; - remote_send $dest "\n"; + remote_raw_open $dest raw + remote_send $dest "\n" remote_expect $dest 5 { -re "$shell_prompt" { - set do_reboot 1; + set do_reboot 1 } -re "Press any key to stop auto-boot" { - remote_send $dest "\n"; - exp_continue; + remote_send $dest "\n" + exp_continue } -re "VxWorks Boot" { - set boot_mon 0; - set boot_mon_prompt "VxWorks Boot"; + set boot_mon 0 + set boot_mon_prompt "VxWorks Boot" } -re "\[0-9\]\[\r\n\]+ *\[0-9\]\[\r\n\]" { - remote_send $dest "\n"; - exp_continue; + remote_send $dest "\n" + exp_continue } timeout { - set do_reboot 1; + set do_reboot 1 } } if { $do_reboot } { - remote_close $dest; - remote_reboot $dest; - return; + remote_close $dest + remote_reboot $dest + return } - remote_binary $dest; - remote_send $dest "\n\n"; + remote_binary $dest + remote_send $dest "\n\n" remote_expect $dest 3 { timeout {} -re ".+" { exp_continue; } } - remote_send $dest "p\n"; + remote_send $dest "p\n" remote_expect $dest 20 { -re "file name\[ \t\]+: (\[^ \r\n\]+)\[ \r\n\]+" { - set curr_file $expect_out(1,string); - exp_continue; + set curr_file $expect_out(1,string) + exp_continue } -re "$boot_mon_prompt" { } } if ![info exists curr_file] { - remote_close $dest; - remote_reboot $dest; - return; + remote_close $dest + remote_reboot $dest + return } if { $curr_file != $desired_kernel } { - verbose "$curr_file != '$desired_kernel'"; + verbose "$curr_file != '$desired_kernel'" # Oh boy. - remote_send $dest "c\n"; + remote_send $dest "c\n" remote_expect $dest 20 { -re "file name\[ \t\]+:.*$" { - remote_send $dest "$desired_kernel\n"; - exp_continue; + remote_send $dest "$desired_kernel\n" + exp_continue } -re "\[a-z() \t\]+:.*$" { - remote_send $dest "\n"; - exp_continue; + remote_send $dest "\n" + exp_continue } -re "$boot_mon_prompt" {} } } - remote_send $dest "@\n"; + remote_send $dest "@\n" remote_expect $dest 30 { -re "(^|\[\r\n\])$shell_prompt" {} -re ".+" { - exp_continue; + exp_continue } } - vxworks_final_init $dest; - remote_close $dest; + vxworks_final_init $dest + remote_close $dest } proc vxworks_final_init { dest } { @@ -116,7 +116,7 @@ proc vxworks_final_init { dest } { if { [target_compile [board_info $dest preload_obj] foo.out object [board_info $dest preload_obj_flags]] == "" } { vxworks_ld $dest foo.out } - remote_file build delete foo.out; + remote_file build delete foo.out } } # @@ -124,102 +124,102 @@ proc vxworks_final_init { dest } { # proc vxworks_exec { dest program pargs inp outp } { - global decimal hex; + global decimal hex - set shell_id [vxworks_open $dest]; + set shell_id [vxworks_open $dest] if { $shell_id < 0 } { - return [list -1 "open failure"]; + return [list -1 "open failure"] } if { $inp != "" } { - set inp [remote_download $dest $inp]; - set suffix " < $inp"; + set inp [remote_download $dest $inp] + set suffix " < $inp" } else { set suffix "" } - set shell_prompt [board_info $dest shell_prompt]; - remote_send $dest "${program} ${pargs}$suffix\n"; + set shell_prompt [board_info $dest shell_prompt] + remote_send $dest "${program} ${pargs}$suffix\n" # FIXME: The value 300 below should probably be a parameter passed in. remote_expect $dest 300 { -re "\\\[VxWorks Boot\\\]:" { - remote_send $dest "@\n"; - sleep 20; - exp_continue; + remote_send $dest "@\n" + sleep 20 + exp_continue } -re "(.*)value = (-*$decimal) = $hex\[^\r\n\]*\[\r\n\]+$shell_prompt" { - set result [list $expect_out(2,string) $expect_out(1,string)]; + set result [list $expect_out(2,string) $expect_out(1,string)] } -re "undefined symbol: .*$shell_prompt" { - set result [list 1 "unknown command"]; + set result [list 1 "unknown command"] } -re "syntax error.*$shell_prompt" { - set result [list -1 "syntax error in command"]; + set result [list -1 "syntax error in command"] } default { - set result [list -1 "unable to execute command"]; + set result [list -1 "unable to execute command"] } } if { $suffix != "" } { - remote_file $dest delete $inp; + remote_file $dest delete $inp } - return $result; + return $result } proc vxworks_download { dest localfile remotefile } { if [board_info $dest exists vxworks_homedir] { - set rfile "[board_info $dest vxworks_homedir]/$remotefile"; - remote_download build $localfile $rfile; - return $rfile; + set rfile "[board_info $dest vxworks_homedir]/$remotefile" + remote_download build $localfile $rfile + return $rfile } - return [remote_raw_download $dest $localfile $remotefile]; + return [remote_raw_download $dest $localfile $remotefile] } proc vxworks_file { dest op args } { - set file [lindex $args 0]; + set file [lindex $args 0] if [board_info $dest exists vxworks_homedir] { - set dir "[board_info $dest vxworks_homedir]"; + set dir "[board_info $dest vxworks_homedir]" switch $op { exists { - set file "${dir}/[file tail $file]"; - return [file exists $file]; + set file "${dir}/[file tail $file]" + return [file exists $file] } delete { foreach x $args { - set x "${dir}/[file tail $x]"; + set x "${dir}/[file tail $x]" if { [file exists $x] && [file isfile $x] } { - exec rm -f $x; + exec rm -f $x } } - return; + return } } } - return [eval remote_raw_file \"$dest\" \"$op\" $args]; + return [eval remote_raw_file \"$dest\" \"$op\" $args] } proc vxworks_send { dest string } { # Convert LFs to CRs, 'cause that is what VxWorks wants to see. - regsub -all "\n" $string "\r" string; + regsub -all "\n" $string "\r" string verbose "Sending '$string' to $dest" 2 - return [remote_raw_send $dest "$string"]; + return [remote_raw_send $dest "$string"] } proc vxworks_open { dest args } { if [board_info $dest exists fileid] { - return [board_info $dest fileid]; + return [board_info $dest fileid] } set shell_prompt [board_info $dest shell_prompt] - set shell_id [remote_raw_open $dest]; + set shell_id [remote_raw_open $dest] if { $shell_id == "" || $shell_id < 0 } { - return -1; + return -1 } if [board_info $dest exists logname] { - set logname [board_info $dest logname]; + set logname [board_info $dest logname] if [board_info $dest exists password] { remote_send $dest "iam \"$logname\",\"[board_info $dest passwd]\"\r" } else { @@ -235,26 +235,26 @@ proc vxworks_open { dest args } { # or `warning' should be used here. There are *lots* of other # cases like this. perror "Couldn't set default user." - return -1; + return -1 } } } - set dir ""; + set dir "" if [board_info $dest exists ftp_directory] { - set dir [board_info $dest ftp_directory]; + set dir [board_info $dest ftp_directory] } if [board_info $dest exists vxworks_homedir] { - set dir [board_info $dest vxworks_homedir]; + set dir [board_info $dest vxworks_homedir] } if { $dir != "" } { - set status [remote_exec $dest "cd" "\"$dir\""]; + set status [remote_exec $dest "cd" "\"$dir\""] if [lindex $status 0] { - perror "Error in cd to $dir--[lindex $status 1]"; - return 1; + perror "Error in cd to $dir--[lindex $status 1]" + return 1 } } - return $shell_id; + return $shell_id } # # Load a file into vxworks @@ -269,31 +269,31 @@ proc vxworks_ld { dest prog } { global board_info if { $prog == "" } { - return 1; + return 1 } - set shell_id [remote_open $dest]; + set shell_id [remote_open $dest] if { $shell_id < 0 } { - return -1; + return -1 } - set prog [remote_download $dest $prog]; + set prog [remote_download $dest $prog] - set shell_prompt [board_info $dest shell_prompt]; + set shell_prompt [board_info $dest shell_prompt] # We always want to exit the program via the code at the end. # If the load fails we want `expect_out' stored in the log and this # saves duplicating that code. for { set x 0 ; } { $x < 3 } {incr x; } { - remote_send $dest "\n"; + remote_send $dest "\n" remote_expect $dest 30 { -re ".*$shell_prompt $" { set x 20; } -re "\\\[VxWorks Boot\\\]:" { - remote_send $dest "@\n"; - sleep 20; - exp_continue; + remote_send $dest "@\n" + sleep 20 + exp_continue } timeout { return -1; } } @@ -305,7 +305,7 @@ proc vxworks_ld { dest prog } { while { $result == -7 && $tries < $maxtries } { verbose "Loading $prog into vxworks." - remote_send $dest "ld < $prog\n"; + remote_send $dest "ld < $prog\n" incr tries remote_expect $dest 300 { -re "USER.*command not understood" { @@ -330,7 +330,7 @@ proc vxworks_ld { dest prog } { } -re "value = (-*${decimal}) = ${hex}.*$shell_prompt $" { verbose "Loaded $prog into vxworks." - set board_info([board_info $dest name],vx_module) $expect_out(1,string); + set board_info([board_info $dest name],vx_module) $expect_out(1,string) set result 0 } -re "(.*)$shell_prompt $" { @@ -347,7 +347,7 @@ proc vxworks_ld { dest prog } { send_log "$expect_out(buffer)" } - remote_file $dest delete $prog; + remote_file $dest delete $prog return $result } @@ -360,25 +360,25 @@ proc vxworks_ld { dest prog } { # -1 - unresolved, may be fixed by rebooting # proc vxworks_run { dest function pargs inp outp } { - global hex decimal; + global hex decimal - set shell_prompt [board_info $dest shell_prompt]; - set output ""; + set shell_prompt [board_info $dest shell_prompt] + set output "" # There isn't a command to wait for a thread to finish, so we have to keep # polling. Instead, we expect the status wrapper to return an exit # status. - set status [remote_exec $dest "sp" "$function $pargs" $inp $outp]; + set status [remote_exec $dest "sp" "$function $pargs" $inp $outp] - set tid [lindex $status 0]; + set tid [lindex $status 0] # Bad task id, reboot and try again. if { $tid == -1 || $tid == 0 } { - return -1; + return -1 } - set result 1; + set result 1 # FIXME: The value 300 below should be a parameter. remote_expect $dest 300 { -re "task ${hex} - aborted.*$shell_prompt $" { @@ -388,51 +388,51 @@ proc vxworks_run { dest function pargs inp outp } { } -re "\[\r\n\]syntax error\[\r\n\]" { verbose "weirdness after task started" - set result -1; + set result -1 } -re "(.*)\\*\\*\\* EXIT code ($decimal)\[\r\n\]" { - set output "$expect_out(1,string)"; - set exit_code "$expect_out(2,string)"; + set output "$expect_out(1,string)" + set exit_code "$expect_out(2,string)" if { ($exit_code + 0) != 0 } { - set result 1; + set result 1 } else { - set result 0; + set result 0 } } -re "Operation Fault.*fault type:" { - set result 1; + set result 1 } -re "Bus Error" { # This is here to try to cope with apparently flaky h/w. # This is potentially an error in the testcase, but we don't # really know, do we? warning "Bus Error." - set result 1; - set output "Bus Error"; - remote_reboot $dest; + set result 1 + set output "Bus Error" + remote_reboot $dest } timeout { # Infinite loop? probably. - remote_exec $dest "td" "$tid"; - set result 1; + remote_exec $dest "td" "$tid" + set result 1 } } - return [list $result $output]; + return [list $result $output] } # # Unload the last executable that we loaded, so we can free up its memory. # proc vxworks_unld { dest } { - global board_info; + global board_info if [board_info $dest exists vx_module] { # Vxworks5.0 does not have the unld command. if { [board_info $dest os] != "vxworks5.0" } { - remote_exec $dest "unld" "[board_info $dest vx_module]"; + remote_exec $dest "unld" "[board_info $dest vx_module]" } - unset board_info([board_info $dest name],vx_module); + unset board_info([board_info $dest name],vx_module) } } @@ -441,55 +441,55 @@ proc vxworks_unld { dest } { # "work" or we give up. # proc vxworks_load {dest prog args} { - set result ""; - set output ""; + set result "" + set output "" if { [llength $args] > 0 } { - set pargs "[lindex $args 0]"; + set pargs "[lindex $args 0]" } else { set pargs "" } if { [llength $args] > 1 } { - set inp "[lindex $args 1]"; + set inp "[lindex $args 1]" } else { set inp "" } if { [llength $args] > 2 } { - set outp "[lindex $args 2]"; + set outp "[lindex $args 2]" } else { set outp "" } for { set x 0; } { $x < 3 } { incr x } { - set status [vxworks_ld $dest $prog]; + set status [vxworks_ld $dest $prog] if { $status >= 0 } { if { $status > 0 } { - set result "fail"; + set result "fail" } else { - set out [vxworks_run $dest __wrap_main $pargs $inp $outp]; - set status [lindex $out 0]; - set output [lindex $out 1]; + set out [vxworks_run $dest __wrap_main $pargs $inp $outp] + set status [lindex $out 0] + set output [lindex $out 1] # Get rid of the carriage returns, because they confuse # callers that try to parse the result. regsub -all "\r" $output "" output if { $status != 0 } { if { $status > 0 } { - set result "fail"; + set result "fail" } } else { - set result "pass"; + set result "pass" } } } if { $result != "" } { - vxworks_unld $dest; - return [list $result $output]; + vxworks_unld $dest + return [list $result $output] } - remote_reboot $dest; + remote_reboot $dest } - return [list "fail" ""]; + return [list "fail" ""] } set_board_info protocol "vxworks" @@ -507,5 +507,5 @@ set_board_info wrap_compile_flags "-DNO_UNISTD_H" set_board_info gdb_prompt "\[(\]vxgdb\[)\]" -set_board_info is_vxworks 1; -set_board_info gdb,nosignals 1; +set_board_info is_vxworks 1 +set_board_info gdb,nosignals 1 |