From cb5ae80a5aa287f9b9f6656700b034dc39df8795 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Sat, 16 Feb 2013 13:05:35 -0700 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ config/adb.exp | 23 ++++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 609dc6c..01f30c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-02-16 Rob Savoye + + * config/adb.exp: Add adb_file so we can remotely delete test + cases to save on limited disk space. Don't remove the file after + executing it, leave that for the test driver instead. + 2013-02-15 Rob Savoye * config/adb.exp: Remove the test case after executing 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 } { -- 2.7.4