aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Savoye <rob@welcomehome.org>2013-02-15 20:56:50 -0700
committerRob Savoye <rob@welcomehome.org>2013-02-15 20:56:50 -0700
commitf22aae7397c09028649412d5c726593038fe762f (patch)
tree695dc43e6bfb8aaac5d6695a3e52cb20cecb5dd9
parentde48b490c3a7a7cc00feac188e9a43e02b48d5ae (diff)
downloaddejagnu-f22aae7397c09028649412d5c726593038fe762f.zip
dejagnu-f22aae7397c09028649412d5c726593038fe762f.tar.gz
dejagnu-f22aae7397c09028649412d5c726593038fe762f.tar.bz2
remove test case after execution to save on disk space.
-rw-r--r--ChangeLog6
-rw-r--r--config/adb.exp13
2 files changed, 19 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b76ed8..609dc6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-02-15 Rob Savoye <rob@welcomehome.org>
+
+ * config/adb.exp: Remove the test case after executing
+ it. Otherwise we can fill up all the diskspace on a small target
+ pretty fast.
+
2013-02-11 Rob Savoye <rob@welcomehome.org>
* baseboards/androideabi.exp: Board support for Android using ADB.
diff --git a/config/adb.exp b/config/adb.exp
index 47e4a7a..b2f8a86 100644
--- a/config/adb.exp
+++ b/config/adb.exp
@@ -16,6 +16,10 @@
# 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
#
@@ -128,6 +132,8 @@ proc adb_upload {desthost srcfile destfile} {
# Execute "$cmd $args[0]" on $boardname.
#
proc adb_exec { boardname cmd args } {
+ global remove_test
+
if { [llength $args] > 0 } {
set pargs [lindex $args 0]
if { [llength $args] > 1 } {
@@ -150,12 +156,19 @@ proc adb_exec { boardname cmd args } {
verbose "Executing $boardname:$cmd $pargs < $inp "
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 } {
regsub "XYZ(\[0-9\]*)ZYX\n?" $output "" output
return [list -1 "adb to $boardname failed for $cmd, $output"]
}
+
regexp "XYZ(\[0-9\]*)ZYX" $output junk status
verbose "adb_exec: status:$status text:$output" 4
if { $status == "" } {