diff options
author | Ben Elliston <bje@gnu.org> | 2011-03-15 13:02:04 +1100 |
---|---|---|
committer | Ben Elliston <bje@gnu.org> | 2011-03-15 13:02:04 +1100 |
commit | 126a089777158a7891ff975473939f08c0e31a1c (patch) | |
tree | ac2690dfc647a50ad4cc9a10d1197f64befae74e /lib | |
parent | c24622e0f2e30eda9bfb357d7b957d4cb9e3ee69 (diff) | |
download | dejagnu-126a089777158a7891ff975473939f08c0e31a1c.zip dejagnu-126a089777158a7891ff975473939f08c0e31a1c.tar.gz dejagnu-126a089777158a7891ff975473939f08c0e31a1c.tar.bz2 |
* runtest.exp: Whitespace cleanups.
* lib/dejagnu.exp, lib/dg.exp, lib/framework.exp,
lib/libgloss.exp, lib/remote.exp, lib/rsh.exp, lib/target.exp,
lib/telnet.exp, lib/tip.exp, lib/utils.exp: Likewise.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dejagnu.exp | 1 | ||||
-rw-r--r-- | lib/dg.exp | 12 | ||||
-rw-r--r-- | lib/framework.exp | 50 | ||||
-rw-r--r-- | lib/libgloss.exp | 10 | ||||
-rw-r--r-- | lib/remote.exp | 44 | ||||
-rw-r--r-- | lib/rsh.exp | 4 | ||||
-rw-r--r-- | lib/target.exp | 32 | ||||
-rw-r--r-- | lib/telnet.exp | 2 | ||||
-rw-r--r-- | lib/tip.exp | 6 | ||||
-rw-r--r-- | lib/utils.exp | 63 |
10 files changed, 111 insertions, 113 deletions
diff --git a/lib/dejagnu.exp b/lib/dejagnu.exp index d20212b..2a60908 100644 --- a/lib/dejagnu.exp +++ b/lib/dejagnu.exp @@ -203,4 +203,3 @@ proc host_execute {args} { catch close return "" } - @@ -672,10 +672,10 @@ proc dg-test { args } { # Define our own "special function" `unknown' so we catch spelling errors. # But first rename the existing one so we can restore it afterwards. if { [info procs dg-save-unknown] == [list] } { - rename unknown dg-save-unknown - proc unknown { args } { + rename unknown dg-save-unknown + proc unknown { args } { return -code error "unknown dg option: $args" - } + } } set tmp [dg-get-options $prog] @@ -700,8 +700,8 @@ proc dg-test { args } { # Restore normal error handling. if { [info procs dg-save-unknown] != [list] } { - rename unknown "" - rename dg-save-unknown unknown + rename unknown "" + rename dg-save-unknown unknown } # If we're not supposed to try this test on this target, we're done. @@ -737,7 +737,7 @@ proc dg-test { args } { set comment [lindex $i 3] #send_user "Before:\n$comp_output\n" if {[regsub -all "(^|\n)(\[^\n\]+$line\[^\n\]*($pattern)\[^\n\]*\n?)+" $comp_output "\n" comp_output]} { - set comp_output [string trimleft $comp_output] + set comp_output [string trimleft $comp_output] set ok pass set uhoh fail } else { diff --git a/lib/framework.exp b/lib/framework.exp index 70cabb1..e8cd7f9 100644 --- a/lib/framework.exp +++ b/lib/framework.exp @@ -75,9 +75,9 @@ proc open_logs { } { if { $xml } { catch "exec rm -f $outdir/$tool.xml" set xml_file [open [file join $outdir $tool.xml] w] - xml_output "<?xml version=\"1.0\"?>" - insertdtd - xml_output "<testsuite>" + xml_output "<?xml version=\"1.0\"?>" + insertdtd + xml_output "<testsuite>" } catch "exec rm -f $outdir/$tool.log" log_file -a "$outdir/$tool.log" @@ -96,8 +96,8 @@ proc close_logs { } { global xml_file if { $xml } { - xml_output "</testsuite>" - catch "close $xml_file" + xml_output "</testsuite>" + catch "close $xml_file" } catch "close $sum_file" @@ -441,13 +441,13 @@ proc log_summary { args } { set val $test_counts($x,$which) if { $val > 0 } { set mess "# of $test_counts($x,name)" - if { $xml } { - xml_output " <summary>" - xml_output " <result>$x</result>" - xml_output " <description>$mess</description>" - xml_output " <total>$val</total>" - xml_output " </summary>" - } + if { $xml } { + xml_output " <summary>" + xml_output " <result>$x</result>" + xml_output " <description>$mess</description>" + xml_output " <total>$val</total>" + xml_output " </summary>" + } if { [string length $mess] < 24 } { append mess "\t" } @@ -702,25 +702,25 @@ proc record_test { type message args } { if { $xml } { global errorInfo - set error "" - if {[info exists errorInfo]} { + set error "" + if {[info exists errorInfo]} { set error $errorInfo - } - global expect_out + } + global expect_out set rio { "" "" } if { [catch { set rio [split $expect_out(buffer) "\n"] } result]} { #do nothing - leave as { "" "" } } - - set output "" + + set output "" set output "expect_out(buffer)" - xml_output " <test>" - xml_output " <input>[string trimright [lindex $rio 0]]</input>" - xml_output " <output>[string trimright [lindex $rio 1]]</output>" - xml_output " <result>$type</result>" - xml_output " <name>$message</name>" - xml_output " <prms_id>$prms_id</prms_id>" - xml_output " </test>" + xml_output " <test>" + xml_output " <input>[string trimright [lindex $rio 0]]</input>" + xml_output " <output>[string trimright [lindex $rio 1]]</output>" + xml_output " <result>$type</result>" + xml_output " <name>$message</name>" + xml_output " <prms_id>$prms_id</prms_id>" + xml_output " </test>" } switch $type { diff --git a/lib/libgloss.exp b/lib/libgloss.exp index 6afdd73..e651eb6 100644 --- a/lib/libgloss.exp +++ b/lib/libgloss.exp @@ -455,7 +455,7 @@ proc get_multilibs { args } { # extract the options and their directory names as know by gcc foreach i "[exec $compiler --print-multi-lib]" { - if {$extra != ""} { + if {$extra != ""} { # string trimright would do the wrong thing if we included # the leading @@ in $extra set i [string trimright $i $extra] @@ -474,9 +474,9 @@ proc get_multilibs { args } { if { [llength $args] > 0 } { set override_opt [lindex $args 0] foreach j $opts { - if {$j == $override_opt} { - set mopts $override_opt - } + if {$j == $override_opt} { + set mopts $override_opt + } } } } @@ -729,7 +729,7 @@ proc find_nm {} { if {![is_remote host]} { set NM [lookfor_file $tool_root_dir nm-new] if {$NM == ""} { - set NM [lookfor_file $tool_root_dir binutils/nm-new] + set NM [lookfor_file $tool_root_dir binutils/nm-new] } } if { $NM == ""} { diff --git a/lib/remote.exp b/lib/remote.exp index e270f85..966e167 100644 --- a/lib/remote.exp +++ b/lib/remote.exp @@ -214,9 +214,9 @@ proc local_exec { commandline inp outp timeout } { } verbose "output is $output status $status" if { $outp == "" || $outp == "|& cat" } { - return [list $status $output] + return [list $status $output] } else { - return [list $status ""] + return [list $status ""] } } @@ -605,20 +605,20 @@ proc standard_transmit {dest file} { set chars 0 set fd [open $file r] while { [gets $fd cur_line] >= 0 } { - set errmess "" - catch "send -i $shell_id \"$cur_line\r\"" errmess - if {[string match "write\(spawn_id=\[0-9\]+\):" $errmess]} { - perror "sent \"$cur_line\" got expect error \"$errmess\"" - catch "close $fd" - return -1 - } + set errmess "" + catch "send -i $shell_id \"$cur_line\r\"" errmess + if {[string match "write\(spawn_id=\[0-9\]+\):" $errmess]} { + perror "sent \"$cur_line\" got expect error \"$errmess\"" + catch "close $fd" + return -1 + } set chars [expr {$chars + ([string length $cur_line] * 10)}] if { $chars > $baud } { sleep 1 set chars 0 } - verbose "." 3 - verbose "Sent $cur_line" 4 + verbose "." 3 + verbose "Sent $cur_line" 4 incr lines } verbose "$lines lines transmitted" 2 @@ -641,7 +641,7 @@ proc standard_send { dest string } { } else { set shell_id [board_info $dest fileid] verbose "shell_id in standard_send is $shell_id" 3 - verbose "send -i [board_info $dest fileid] -- $string" 3 + verbose "send -i [board_info $dest fileid] -- $string" 3 if {[catch "send -i [board_info $dest fileid] -- \$string" errorInfo]} { return "$errorInfo" } else { @@ -848,13 +848,13 @@ proc standard_spawn { dest commandline } { global board_info if {![board_info $dest exists rsh_prog]} { - if { [which remsh] != 0 } { - set RSH remsh - } else { - set RSH rsh - } + if { [which remsh] != 0 } { + set RSH remsh + } else { + set RSH rsh + } } else { - set RSH [board_info $dest rsh_prog] + set RSH [board_info $dest rsh_prog] } if {[board_info $dest exists hostname]} { @@ -864,9 +864,9 @@ proc standard_spawn { dest commandline } { } if {![board_info $dest exists username]} { - spawn $RSH $remote $commandline + spawn $RSH $remote $commandline } else { - spawn $RSH -l [board_info $dest username] $remote $commandline + spawn $RSH -l [board_info $dest username] $remote $commandline } set board_info($dest,fileid) $spawn_id @@ -1142,7 +1142,7 @@ proc check_for_board_status { variable } { if {[regexp "(^|\[\r\n\])\\*\\*\\* EXIT code" $output]} { regsub "^.*\\*\\*\\* EXIT code " $output "" result regsub "\[\r\n\].*$" $result "" result - regsub -all "(^|\[\r\n\]|\r\n)\\*\\*\\* EXIT code \[^\r\n\]*(\[\r\n\]\[\r\n\]?|$)" $output "" output + regsub -all "(^|\[\r\n\]|\r\n)\\*\\*\\* EXIT code \[^\r\n\]*(\[\r\n\]\[\r\n\]?|$)" $output "" output regsub "^\[^0-9\]*" $result "" result regsub "\[^0-9\]*$" $result "" result verbose "got board status $result" 3 @@ -1248,7 +1248,7 @@ proc remote_expect { board timeout args } { } if {$code == 1} { - if {[info exists string]} {send_user "ERROR OCCURED: $errorInfo $errorCode $string"} + if {[info exists string]} {send_user "ERROR OCCURED: $errorInfo $errorCode $string"} if { $error_sect != "" } { set code [catch {uplevel $error_sect} string] diff --git a/lib/rsh.exp b/lib/rsh.exp index ab2e1e0..0e3eb07 100644 --- a/lib/rsh.exp +++ b/lib/rsh.exp @@ -150,7 +150,7 @@ proc rsh_download {desthost srcfile destfile} { if {[board_info $desthost exists rcp_prog]} { set RCP [board_info $desthost rcp_prog] } else { - set RCP rcp + set RCP rcp } if {[board_info $desthost exists rsh_prog]} { @@ -194,7 +194,7 @@ proc rsh_upload {desthost srcfile destfile} { if {[board_info $desthost exists rcp_prog]} { set RCP [board_info $desthost rcp_prog] } else { - set RCP rcp + set RCP rcp } if {[board_info $desthost exists username]} { diff --git a/lib/target.exp b/lib/target.exp index 6d82422..c9fde2c 100644 --- a/lib/target.exp +++ b/lib/target.exp @@ -134,7 +134,7 @@ proc prune_warnings { text } { # See Brendan for the raison d'etre of this one. if {[ishost "alpha*-*-*"]} { - regsub -all "(^|\n)(/usr/(ucb|bin)/ld.*without exceptions was\[^\n\]+\n?)" $text "\\1" text + regsub -all "(^|\n)(/usr/(ucb|bin)/ld.*without exceptions was\[^\n\]+\n?)" $text "\\1" text } if {[ishost "hppa*-*-hpux*"]} { # Ignore the compiler's warnings about PA incompatibility. @@ -245,7 +245,7 @@ proc prune_warnings { text } { # See Brendan for the raison d'etre of this one. if {[string match "alpha*-*-*" $host_triplet]} { - regsub -all "(^|\n)(/usr/(ucb|bin)/ld.*without exceptions was\[^\n\]+\n?)" $text "\\1" text + regsub -all "(^|\n)(/usr/(ucb|bin)/ld.*without exceptions was\[^\n\]+\n?)" $text "\\1" text } # Don't pay attention to the AIX4 linker warnings. @@ -295,9 +295,9 @@ proc prune_warnings { text } { proc target_compile {source destfile type options} { set target [target_info name] if { [info proc ${target}_compile] != "" } { - return [${target}_compile $source $destfile $type $options] + return [${target}_compile $source $destfile $type $options] } else { - return [default_target_compile $source $destfile $type $options] + return [default_target_compile $source $destfile $type $options] } } @@ -341,7 +341,7 @@ proc default_target_compile {source destfile type options} { set compiler [find_gnatmake] } } - + if { $i == "c++" } { set compiler_type "c++" if {[board_info $dest exists cxxflags]} { @@ -402,15 +402,15 @@ proc default_target_compile {source destfile type options} { if {[regexp "^ldscript=" $i]} { regsub "^ldscript=" $i "" ldscript } - if {[regexp "^redirect=" $i]} { - regsub "^redirect=" $i "" redirect - } - if {[regexp "^optimize=" $i]} { - regsub "^optimize=" $i "" optimize - } - if {[regexp "^timeout=" $i]} { - regsub "^timeout=" $i "" timeout - } + if {[regexp "^redirect=" $i]} { + regsub "^redirect=" $i "" redirect + } + if {[regexp "^optimize=" $i]} { + regsub "^optimize=" $i "" optimize + } + if {[regexp "^timeout=" $i]} { + regsub "^timeout=" $i "" timeout + } } if {[board_info $host exists cflags_for_target]} { @@ -589,9 +589,9 @@ proc default_target_compile {source destfile type options} { # object, because otherwise, in some situations, libtool will # become confused about the name of the actual source file. if {$type == "object"} { - set opts "$add_flags $sources" + set opts "$add_flags $sources" } else { - set opts "$sources $add_flags" + set opts "$sources $add_flags" } if {[is_remote host]} { diff --git a/lib/telnet.exp b/lib/telnet.exp index 69c1861..8f4a211 100644 --- a/lib/telnet.exp +++ b/lib/telnet.exp @@ -73,7 +73,7 @@ proc telnet_open { hostname args } { } if {[board_info $connhost exists shell_prompt]} { - set shell_prompt [board_info $connhost shell_prompt] + set shell_prompt [board_info $connhost shell_prompt] } if {![info exists shell_prompt]} { # If no prompt, then set it to something generic. diff --git a/lib/tip.exp b/lib/tip.exp index 0a3634c..82e4cd5 100644 --- a/lib/tip.exp +++ b/lib/tip.exp @@ -107,7 +107,7 @@ proc tip_open { hostname } { "~\[set\]*" { verbose "Setting verbose mode" 1 send "verbose\n\n\n" - } + } } if { $result < 0 } { @@ -172,11 +172,11 @@ proc tip_download { dest file args } { perror "Timed out trying to download." } } - } + } timeout { perror "Timed out waiting for response to put command." } - } + } set timeout 10 return $result } diff --git a/lib/utils.exp b/lib/utils.exp index 4368721..a01d306 100644 --- a/lib/utils.exp +++ b/lib/utils.exp @@ -27,7 +27,7 @@ # args: the first is the dir to look in, the next # is the pattern to match. It # defaults to *. Patterns are csh style -# globbing rules +# globbing rules # options: -all search the tree recursively # returns: a list of dirs or NULL; the root directory is not returned. # @@ -71,7 +71,7 @@ proc getdirs { args } { } } } - } + } } else { perror "$tmp" return "" @@ -242,7 +242,7 @@ proc slay { name } { # proc absolute { path } { if {[string match "." $path]} { - return [pwd] + return [pwd] } set basedir [pwd] @@ -319,64 +319,64 @@ proc diff { file_1 file_2 } { set differences 0 if {[file exists ${file_1}]} { - set file_a [open ${file_1} r] - fconfigure $file_a -encoding binary + set file_a [open ${file_1} r] + fconfigure $file_a -encoding binary } else { - warning "${file_1} doesn't exist" - return 0 + warning "${file_1} doesn't exist" + return 0 } if {[file exists ${file_2}]} { - set file_b [open ${file_2} r] - fconfigure $file_b -encoding binary + set file_b [open ${file_2} r] + fconfigure $file_b -encoding binary } else { - warning "${file_2} doesn't exist" - return 0 + warning "${file_2} doesn't exist" + return 0 } verbose "# Diff'ing: ${file_1} ${file_2}\n" 1 set list_a "" while { [gets ${file_a} line] != ${eof} } { - if {[regexp "^#.*$" ${line}]} { - continue - } else { - lappend list_a ${line} - } + if {[regexp "^#.*$" ${line}]} { + continue + } else { + lappend list_a ${line} + } } close ${file_a} set list_b "" while { [gets ${file_b} line] != ${eof} } { - if {[regexp "^#.*$" ${line}]} { - continue - } else { - lappend list_b ${line} - } + if {[regexp "^#.*$" ${line}]} { + continue + } else { + lappend list_b ${line} + } } close ${file_b} for { set i 0 } { $i < [llength $list_a] } { incr i } { - set line_a [lindex ${list_a} ${i}] - set line_b [lindex ${list_b} ${i}] + set line_a [lindex ${list_a} ${i}] + set line_b [lindex ${list_b} ${i}] # verbose "\t${file_1}: ${i}: ${line_a}\n" 3 # verbose "\t${file_2}: ${i}: ${line_b}\n" 3 - if {[string compare ${line_a} ${line_b}]} { + if {[string compare ${line_a} ${line_b}]} { verbose "line #${i}\n" 2 - verbose "\< ${line_a}\n" 2 - verbose "\> ${line_b}\n" 2 + verbose "\< ${line_a}\n" 2 + verbose "\> ${line_b}\n" 2 send_log "line #${i}\n" - send_log "\< ${line_a}\n" - send_log "\> ${line_b}\n" + send_log "\< ${line_a}\n" + send_log "\> ${line_b}\n" - set differences -1 - } + set differences -1 + } } if { $differences == -1 || [llength ${list_a}] != [llength ${list_b}] } { verbose "Files not the same" 2 - set differences -1 + set differences -1 } else { verbose "Files are the same" 2 set differences 1 @@ -413,4 +413,3 @@ proc getenv { var } { return "" } } - |