aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Savoye <rob@welcomehome.org>2013-02-11 13:31:44 -0700
committerRob Savoye <rob@welcomehome.org>2013-02-11 13:31:44 -0700
commitd8912f7d0567831f425115eaeb6ee915e8ea5b21 (patch)
tree8bd8b0ca252b1c24bdd6b59931bba7ed77077c68
parent33b71e46c0a27fee374a922eb0792b9c618c54a8 (diff)
downloaddejagnu-d8912f7d0567831f425115eaeb6ee915e8ea5b21.zip
dejagnu-d8912f7d0567831f425115eaeb6ee915e8ea5b21.tar.gz
dejagnu-d8912f7d0567831f425115eaeb6ee915e8ea5b21.tar.bz2
tweak serial config for Android.
-rw-r--r--baseboards/androideabi.exp6
-rw-r--r--config/adb.exp22
2 files changed, 18 insertions, 10 deletions
diff --git a/baseboards/androideabi.exp b/baseboards/androideabi.exp
index 75e15c7..4ba2d63 100644
--- a/baseboards/androideabi.exp
+++ b/baseboards/androideabi.exp
@@ -23,7 +23,7 @@ load_base_board_description "adb"
set_board_info compiler "[find_gcc]"
-# We need -mandroid.
+# We may need -mandroid.
set_board_info cflags "-mandroid"
# Currently the dynamic linker does not support weak-references in
@@ -34,9 +34,9 @@ set_board_info ldflags "-mandroid -static"
# load PROG to DEST and run it with ARGS using adb
#
proc adb_load { dest prog args } {
- # /sqlite_stmt_journals uses tmpfs. So it is the default place to run
+ # This directory uses tmpfs, so it is the best place to run
# tests to avoid excessive wear of flash.
- set android_tmp_dir "/sqlite_stmt_journals"
+ set android_tmp_dir "/mnt/sdcard/.android_secure"
if { [llength $args] > 0 } {
set pargs [lindex $args 0]
diff --git a/config/adb.exp b/config/adb.exp
index dd69066..47e4a7a 100644
--- a/config/adb.exp
+++ b/config/adb.exp
@@ -46,14 +46,19 @@ proc adb_open { hostname } {
if [board_info ${hostname} exists shell_prompt] {
set shell_prompt [board_info ${hostname} shell_prompt]
} else {
- set shell_prompt "# "
+ set shell_prompt "root@android:/ # "
}
if [board_info $hostname exists fileid] {
unset board_info($hostname,fileid)
}
- spawn adb [adb_serial] shell
+ set serial [adb_serial]
+ if { $serial != "" } {
+ spawn adb [adb_serial] shell
+ } else {
+ spawn adb shell
+ }
if { $spawn_id < 0 } {
perror "invalid spawn id from adb"
return -1
@@ -80,7 +85,7 @@ proc adb_open { hostname } {
if { $result < 0 } {
# perror "adb shell: couldn't connect after $tries tries."
- close -i $spawn_id
+ catch "close -i $spawn_id"
set spawn_id -1
} else {
set board_info($hostname,fileid) $spawn_id
@@ -94,8 +99,11 @@ proc adb_open { hostname } {
#
proc adb_download {desthost srcfile destfile} {
- set status [catch "exec adb [adb_serial] shell rm $destfile |& cat" output]
- set status [catch "exec adb [adb_serial] push $srcfile $destfile |& cat" output]
+ set serial [adb_serial]
+ verbose "Removing old executable: adb $serial shell rm $destfile" 3
+ set status [catch "exec adb $serial shell rm $destfile |& cat" output]
+ verbose "Downloading: adb $serial shell push $srcfile $destfile" 3
+ set status [catch "exec adb $serial push $srcfile $destfile |& cat" output]
if { $status == 0 } {
verbose "Copied $srcfile to $destfile" 2
return $destfile
@@ -132,8 +140,6 @@ proc adb_exec { boardname cmd args } {
set inp ""
}
- verbose "Executing $boardname:$cmd $pargs < $inp"
-
# If CMD sends any output to stderr, exec will think it failed. More often
# than not that will be true, but it doesn't catch the case where there is
# no output but the exit code is non-zero.
@@ -141,6 +147,8 @@ proc adb_exec { boardname cmd args } {
set inp "/dev/null"
}
+ verbose "Executing $boardname:$cmd $pargs < $inp "
+
set status [catch "exec cat $inp | adb [adb_serial] shell \( $cmd $pargs \) \\; echo XYZ\\\$\\\{\?\\\}ZYX |& cat" output]
# `status' doesn't mean much here other than adb worked ok.
# What we want is whether $cmd ran ok.