* lib/dejagnu.exp: Likewise.
* lib/remote.exp: Likewise.
* lib/utils.exp: Likewise.
2016-03-21 Ben Elliston <bje@gnu.org>
+ * runtest.exp: Whitespace, comment and typo fixes.
+ * lib/dejagnu.exp: Likewise.
+ * lib/remote.exp: Likewise.
+ * lib/utils.exp: Likewise.
+
+2016-03-21 Ben Elliston <bje@gnu.org>
+
* baseboards/mcore-moto-sim.exp: Remove old FIXME comment.
* baseboards/mmixware-sim.exp: Likewise.
* config/sim.exp: Likewise.
# 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
}
# 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 != "" } {
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,
set result2 5
}
} else {
+ # Use a command pipeline with open.
if { $inp != "" } {
set inp "< $inp"
set mode "r"
exp_continue -continue_timer
}
timeout {
- warning "program timed out."
+ warning "program timed out"
}
eof {
set got_eof 1
# 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
}
}
+
# 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.
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
}
-# 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
}
}
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}]
verbose "Files are the same" 2
set differences 1
}
- return ${differences}
+ return $differences
}
-#
+
# Set an environment variable
#
proc setenv { var val } {
unset env($var)
}
+
# Get a value from an environment variable
#
proc getenv { var } {
#
# 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
# 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
if { $host_triplet == "" } {
set host_triplet $build_triplet
}
-
}
#