diff options
Diffstat (limited to 'config/adb.exp')
-rw-r--r-- | config/adb.exp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/config/adb.exp b/config/adb.exp index b2f8a86..a679e6a 100644 --- a/config/adb.exp +++ b/config/adb.exp @@ -16,10 +16,6 @@ # along with DejaGnu; if not, write to the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# If true, all testcases onthe host target are deleted after being executed -# to save disk space. -set remove_test true - # # Get serial number in case of multiple devices # @@ -117,6 +113,20 @@ proc adb_download {desthost srcfile destfile} { } } +proc adb_file {dest op args} { + set file [lindex $args 0] + verbose "Executing command: $op $args" 2 + switch $op { + exists { + set status [catch "exec adb [adb_serial] shell ls |& cat" out] + } + delete { + set status [catch "exec adb [adb_serial] shell rm $file |& cat" rmout] + } + } + return [eval remote_raw_file \"$dest\" \"$op\" $args] +} + proc adb_upload {desthost srcfile destfile} { set status [catch "exec adb [adb_serial] pull $srcfile $destfile" output] if { $status == 0 } { @@ -157,11 +167,6 @@ proc adb_exec { boardname cmd args } { set status [catch "exec cat $inp | adb [adb_serial] shell \( $cmd $pargs \) \\; echo XYZ\\\$\\\{\?\\\}ZYX |& cat" output] - if { $remove_test == true} { - verbose "Removing test executable: $cmd" 2 - set status [catch "exec adb [adb_serial] shell rm $cmd |& cat" rmout] - } - # `status' doesn't mean much here other than adb worked ok. # What we want is whether $cmd ran ok. if { $status != 0 } { |