From: Ben Elliston Date: Mon, 21 Mar 2016 07:03:24 +0000 (+1100) Subject: * runtest.exp: Whitespace, comment and typo fixes. X-Git-Tag: upstream/1.6.2~133 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44540535ee3cc17d82a55db9959199781757296f;p=platform%2Fupstream%2Fdejagnu.git * runtest.exp: Whitespace, comment and typo fixes. * lib/dejagnu.exp: Likewise. * lib/remote.exp: Likewise. * lib/utils.exp: Likewise. --- diff --git a/ChangeLog b/ChangeLog index 4ad5b02..2ea424b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2016-03-21 Ben Elliston + * runtest.exp: Whitespace, comment and typo fixes. + * lib/dejagnu.exp: Likewise. + * lib/remote.exp: Likewise. + * lib/utils.exp: Likewise. + +2016-03-21 Ben Elliston + * baseboards/mcore-moto-sim.exp: Remove old FIXME comment. * baseboards/mmixware-sim.exp: Likewise. * config/sim.exp: Likewise. diff --git a/lib/dejagnu.exp b/lib/dejagnu.exp index 89016b4..732bdf9 100644 --- a/lib/dejagnu.exp +++ b/lib/dejagnu.exp @@ -83,7 +83,7 @@ proc host_compile {compline} { # prune common warnings and other stuff we can safely ignore set comp_output [prune_warnings $comp_output] - # Trim multiple CR/LF pairs out to keep things consistant + # Trim multiple CR/LF pairs out to keep things consistent regsub "^\[\r\n\]+" $comp_output "" comp_output # if we got a compiler error, log it diff --git a/lib/remote.exp b/lib/remote.exp index 887867c..e0d9d18 100644 --- a/lib/remote.exp +++ b/lib/remote.exp @@ -57,8 +57,7 @@ proc remote_raw_open { args } { } # Close a spawn ID, and wait for the process to die. If PID is not -# -1, then if the process doesn't exit gracefully promptly, we kill -# it. +# -1, then the process is killed if it doesn't exit gracefully. # proc close_wait_program { program_id pid {wres_varname ""} } { if {$wres_varname != "" } { @@ -76,7 +75,7 @@ proc close_wait_program { program_id pid {wres_varname ""} } { set pgid "-$pid" # Send SIGINT to give the program a better chance to interrupt # whatever it might be doing and react to stdin closing. - # E.g., in case of GDB, this should get it back to the prompt. + # eg, in case of GDB, this should get it back to the prompt. exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid)" # If the program doesn't exit gracefully when stdin closes, @@ -158,6 +157,7 @@ proc local_exec { commandline inp outp timeout } { set result2 5 } } else { + # Use a command pipeline with open. if { $inp != "" } { set inp "< $inp" set mode "r" @@ -217,7 +217,7 @@ proc local_exec { commandline inp outp timeout } { exp_continue -continue_timer } timeout { - warning "program timed out." + warning "program timed out" } eof { set got_eof 1 diff --git a/lib/utils.exp b/lib/utils.exp index 505ad18..e2a5040 100644 --- a/lib/utils.exp +++ b/lib/utils.exp @@ -23,6 +23,7 @@ # This file is sourced by runtest.exp, so they are usable by any test # script. + # Gets the directories in a directory, or in a directory tree. # args: the first is the dir to look in, the next # is the pattern to match. It @@ -86,6 +87,7 @@ proc getdirs { args } { } } + # Finds paths of all non-directory files, recursively, whose names match # a pattern. Certain directory name are not searched (see proc getdirs). # rootdir - search in this directory and its subdirectories, recursively. @@ -115,6 +117,7 @@ proc find { rootdir pattern } { return $files } + # Search the path for a file. This is basically a version of the BSD # Unix which(1) utility. This procedure depends on the shell # environment variable $PATH. It returns 0 if $PATH does not exist or @@ -250,10 +253,11 @@ proc runtest_file_p { runtests testcase } { } -# Compares two files line-by-line -# returns 1 it the files match, -# returns 0 if there was a file error, -# returns -1 if they didn't match. +# Compares two files line-by-line just like the Unix diff(1) utility. +# +# Returns 1 if the files match, +# 0 if there was a file error, +# -1 if they did not match. # proc diff { file_1 file_2 } { set eof -1 @@ -296,6 +300,7 @@ proc diff { file_1 file_2 } { } } 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}] @@ -315,10 +320,10 @@ proc diff { file_1 file_2 } { verbose "Files are the same" 2 set differences 1 } - return ${differences} + return $differences } -# + # Set an environment variable # proc setenv { var val } { @@ -333,6 +338,7 @@ proc unsetenv { var } { unset env($var) } + # Get a value from an environment variable # proc getenv { var } { diff --git a/runtest.exp b/runtest.exp index e53afdf..d435db8 100644 --- a/runtest.exp +++ b/runtest.exp @@ -585,7 +585,7 @@ proc lookfor_file { dir name } { # # If there a multiple files with the same name, stop after the first one found. # The order is first look in the install dir, then in a parallel dir in the -# source tree, (up one or two levels), then in the current dir. +# source tree (up one or two levels), then in the current dir. # proc load_lib { file } { global verbose libdir libdirs srcdir base_dir execpath tool @@ -683,7 +683,7 @@ unset arg_host_triplet arg_build_triplet # If the build machine type hasn't been specified by now, use config.guess. # -if {[expr { $build_triplet == "" && $host_triplet == ""} ]} { +if {[expr {$build_triplet == "" && $host_triplet == ""}]} { # find config.guess foreach dir "$libdir $libdir/libexec $libdir/.. $execpath $srcdir $srcdir/.. $srcdir/../.." { verbose "Looking for ${dir}/config.guess" 2 @@ -711,7 +711,6 @@ if {[expr { $build_triplet == "" && $host_triplet == ""} ]} { if { $host_triplet == "" } { set host_triplet $build_triplet } - } #