diff options
author | Rob Savoye <rob@welcomehome.org> | 2013-02-16 13:05:35 -0700 |
---|---|---|
committer | Rob Savoye <rob@welcomehome.org> | 2013-02-16 13:05:35 -0700 |
commit | cb5ae80a5aa287f9b9f6656700b034dc39df8795 (patch) | |
tree | 5569660fae8d6caaa7b8c4cb65a594e0d257eb58 /config/adb.exp | |
parent | f22aae7397c09028649412d5c726593038fe762f (diff) | |
download | dejagnu-cb5ae80a5aa287f9b9f6656700b034dc39df8795.zip dejagnu-cb5ae80a5aa287f9b9f6656700b034dc39df8795.tar.gz dejagnu-cb5ae80a5aa287f9b9f6656700b034dc39df8795.tar.bz2 |
config/adb.exp: Add adb_file so we can remotely delete test case to save on limited disk space. Don't remove the file after executing it, leave that for the test driver instead.
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 } { |