+2016-04-06 Yvan Roux <yvan.roux@linaro.org>
+
+ * lib/remote.exp (remnote_download): Create a remote directory if
+ needed and use it.
+ (remote_exec): Execute program inside remotedir when it exists.
+ (standard_load): Set remotedir board field if not present.
+ * config/unix.exp (unix_load): Handle remotedir in board field.
+ (remotedir): Set board info field.
+ * doc/dejagnu.texi (Board File Values): Document remotedir.
+
2016-04-06 Ben Elliston <bje@gnu.org>
* doc/dejagnu.texi (Global config file): Put before node 'Local
setenv SHLIB_PATH $orig_ld_library_path
}
} else {
- set remotefile "/tmp/[file tail $prog].[pid]"
+ set remotefile [file tail $prog]
set remotefile [remote_download $dest $prog $remotefile]
if { $remotefile == "" } {
verbose -log "Download of $prog to [board_info $dest name] failed." 3
return [list $result $output]
}
+set_board_info remotedir "/tmp/runtest.[pid]"
set_board_info protocol "unix"
support_libs@tab "$@{prefix_dir@}/i386-coff/"@tab Support libraries needed for cross compiling.
@item
addl_link_flags@tab "-N"@tab Additional link flags, rarely used.
+@item
+remotedir@tab "/tmp/runtest.[pid]"@tab Directory on the remote target in which executables are downloaded and executed.
@end multitable
These fields are used by the GCC and GDB tests, and are mostly
if { ![is_remote $hostname] } {
set result [local_exec "$program $pargs" $inp $outp $timeout]
} else {
+ if { [board_info $hostname exists remotedir] } {
+ set remotedir [board_info $hostname remotedir]
+ set program "test -d $remotedir && cd $remotedir && $program"
+ }
set result [call_remote "" exec $hostname $program $pargs $inp $outp]
}
}
}
}
+ if { [board_info $dest exists remotedir] } {
+ set remotedir [board_info $dest remotedir]
+ set status [remote_exec $dest mkdir "-p $remotedir"]
+ if { [lindex $status 0] != 0 } {
+ perror "Couldn't create remote directory $remotedir on $dest"
+ return ""
+ }
+ set destfile "$remotedir/$destfile"
+ }
return [call_remote "" download $dest $file $destfile]
}
# remote_download and remote_exec to load and execute the program.
#
proc standard_load { dest prog args } {
+ global board_info
+
if { [llength $args] > 0 } {
set pargs [lindex $args 0]
} else {
}
if {[is_remote $dest]} {
- set remotefile "/tmp/[file tail $prog].[pid]"
+ if {![board_info $dest exists remotedir]} {
+ set board_info($dest,remotedir) "/tmp/runtest.[pid]"
+ }
+ set remotefile [file tail $prog]
set remotefile [remote_download $dest $prog $remotefile]
if { $remotefile == "" } {
verbose -log "Download of $prog to [board_info $dest name] failed." 3