39 |
set orig_ld_library_path "" |
set orig_ld_library_path "" |
40 |
|
|
41 |
if { [llength $args] > 0 } { |
if { [llength $args] > 0 } { |
42 |
set parg [lindex $args 0]; |
set parg [lindex $args 0] |
43 |
} else { |
} else { |
44 |
set parg "" |
set parg "" |
45 |
} |
} |
46 |
|
|
47 |
if { [llength $args] > 1 } { |
if { [llength $args] > 1 } { |
48 |
set inp [lindex $args 1]; |
set inp [lindex $args 1] |
49 |
} else { |
} else { |
50 |
set inp "" |
set inp "" |
51 |
} |
} |
61 |
if { "$inp" != "" } { |
if { "$inp" != "" } { |
62 |
set command "$prog $parg < $inp" |
set command "$prog $parg < $inp" |
63 |
} else { |
} else { |
64 |
set command "$prog $parg"; |
set command "$prog $parg" |
65 |
} |
} |
66 |
|
|
67 |
if ![info exists ld_library_path] { |
if ![info exists ld_library_path] { |
73 |
setenv SHLIB_PATH "$ld_library_path:$orig_ld_library_path" |
setenv SHLIB_PATH "$ld_library_path:$orig_ld_library_path" |
74 |
verbose -log "Setting LD_LIBRARY_PATH to $ld_library_path:$orig_ld_library_path" 2 |
verbose -log "Setting LD_LIBRARY_PATH to $ld_library_path:$orig_ld_library_path" 2 |
75 |
|
|
76 |
set id [remote_spawn $dest "$command" "readonly"]; |
set id [remote_spawn $dest "$command" "readonly"] |
77 |
if { $id < 0 } { |
if { $id < 0 } { |
78 |
set output "remote_spawn failed" |
set output "remote_spawn failed" |
79 |
set status -1; |
set status -1 |
80 |
} else { |
} else { |
81 |
set status [remote_wait $dest 300]; |
set status [remote_wait $dest 300] |
82 |
set output [lindex $status 1]; |
set output [lindex $status 1] |
83 |
set status [lindex $status 0]; |
set status [lindex $status 0] |
84 |
} |
} |
85 |
# Unset them so we don't potentially get hosed when we try to run a |
# Unset them so we don't potentially get hosed when we try to run a |
86 |
# non-testcase executable. (Setting LD_LIBRARY_PATH is the wrong |
# non-testcase executable. (Setting LD_LIBRARY_PATH is the wrong |
92 |
} |
} |
93 |
} else { |
} else { |
94 |
set remotefile "/tmp/[file tail $prog].[pid]" |
set remotefile "/tmp/[file tail $prog].[pid]" |
95 |
set remotefile [remote_download $dest $prog $remotefile]; |
set remotefile [remote_download $dest $prog $remotefile] |
96 |
if { $remotefile == "" } { |
if { $remotefile == "" } { |
97 |
verbose -log "Download of $prog to [board_info $dest name] failed." 3 |
verbose -log "Download of $prog to [board_info $dest name] failed." 3 |
98 |
return [list "unresolved" ""]; |
return [list "unresolved" ""] |
99 |
} |
} |
100 |
if [board_info $dest exists remote_link] { |
if [board_info $dest exists remote_link] { |
101 |
if [[board_info $dest remote_link] $remotefile] { |
if [[board_info $dest remote_link] $remotefile] { |
111 |
if { [lindex $status 0] != 0 } { |
if { [lindex $status 0] != 0 } { |
112 |
remote_file $dest delete ${remotefile}.o $remotefile |
remote_file $dest delete ${remotefile}.o $remotefile |
113 |
verbose -log "chmod +x of $prog on $dest failed." 3 |
verbose -log "chmod +x of $prog on $dest failed." 3 |
114 |
return [list "unresolved" ""]; |
return [list "unresolved" ""] |
115 |
} |
} |
116 |
} |
} |
117 |
set status [remote_exec $dest "$remotefile" $parg $inp] |
set status [remote_exec $dest "$remotefile" $parg $inp] |
118 |
remote_file $dest delete $remotefile.o $remotefile; |
remote_file $dest delete $remotefile.o $remotefile |
119 |
if { [lindex $status 0] < 0 } { |
if { [lindex $status 0] < 0 } { |
120 |
verbose -log "Couldn't execute $prog, [lindex $status 1]" 3 |
verbose -log "Couldn't execute $prog, [lindex $status 1]" 3 |
121 |
return [list "unresolved" ""] |
return [list "unresolved" ""] |
132 |
verbose -- "$output" 2 |
verbose -- "$output" 2 |
133 |
} |
} |
134 |
if { $status == 0 } { |
if { $status == 0 } { |
135 |
set result "pass"; |
set result "pass" |
136 |
} else { |
} else { |
137 |
set result "fail"; |
set result "fail" |
138 |
} |
} |
139 |
return [list $result $output]; |
return [list $result $output] |
140 |
} |
} |
141 |
|
|
142 |
set_board_info protocol "unix"; |
set_board_info protocol "unix" |