diff --git a/config/unix.exp b/config/unix.exp index c9d80dc..6a0ff72 100644 --- a/config/unix.exp +++ b/config/unix.exp @@ -97,7 +97,7 @@ proc unix_load { dest prog args } { 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 @@ -145,4 +145,5 @@ proc unix_load { dest prog args } { return [list $result $output] } +set_board_info remotedir "/tmp/runtest.[pid]" set_board_info protocol "unix" diff --git a/doc/dejagnu.texi b/doc/dejagnu.texi index 35a0af4..a455ce6 100644 --- a/doc/dejagnu.texi +++ b/doc/dejagnu.texi @@ -2016,6 +2016,8 @@ address@hidden address@hidden The path to the @code{objcopy} program. address@hidden "address@hidden@}/i386-coff/"@tab Support libraries needed for cross compiling. @item address@hidden "-N"@tab Additional link flags, rarely used. address@hidden address@hidden "/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 diff --git a/lib/remote.exp b/lib/remote.exp index 043368b..5184ecb 100644 --- a/lib/remote.exp +++ b/lib/remote.exp @@ -312,6 +312,10 @@ proc remote_exec { hostname program args } { 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 "\[ -d $remotedir \] && cd $remotedir ; $program" + } set result [call_remote "" exec $hostname $program $pargs $inp $outp] } @@ -449,6 +453,15 @@ proc remote_download { dest file args } { } } } + 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] } @@ -1029,6 +1042,8 @@ proc remote_raw_load { dest prog args } { # 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 { @@ -1049,7 +1064,10 @@ proc standard_load { dest prog args } { } 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