Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(694)

Side by Side Diff: platform_tools/android/bin/android_run_skia

Issue 263733006: Add more detailed logging when things go wrong in android_run_skia (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix regex Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 # 2 #
3 # android_run_skia: starts the correct skia program on the device, prints the 3 # android_run_skia: starts the correct skia program on the device, prints the
4 # output, and kills the app if interrupted. 4 # output, and kills the app if interrupted.
5 5
6 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 6 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
7 source $SCRIPT_DIR/android_setup.sh 7 source $SCRIPT_DIR/android_setup.sh
8 source $SCRIPT_DIR/utils/setup_adb.sh 8 source $SCRIPT_DIR/utils/setup_adb.sh
9 9
10 if [ ! -f "${SKIA_OUT}/$BUILDTYPE/lib/lib${APP_ARGS[0]}.so" ]; 10 if [ ! -f "${SKIA_OUT}/$BUILDTYPE/lib/lib${APP_ARGS[0]}.so" ];
11 then 11 then
12 echo "Unable to find $BUILDTYPE ${APP_ARGS[0]} library" 12 echo "Unable to find $BUILDTYPE ${APP_ARGS[0]} library"
13 exit 1 13 exit 1
14 fi 14 fi
15 15
16 adb_push_if_needed "${SKIA_OUT}/$BUILDTYPE/skia_launcher" /data/local/tmp 16 adb_push_if_needed "${SKIA_OUT}/$BUILDTYPE/skia_launcher" /data/local/tmp
17 if [ -f "${SKIA_OUT}/$BUILDTYPE/lib/libskia_android.so" ]; then 17 if [ -f "${SKIA_OUT}/$BUILDTYPE/lib/libskia_android.so" ]; then
18 # Does not exist for builds with static skia. 18 # Does not exist for builds with static skia.
19 adb_push_if_needed "${SKIA_OUT}/$BUILDTYPE/lib/libskia_android.so" /data/loc al/tmp 19 adb_push_if_needed "${SKIA_OUT}/$BUILDTYPE/lib/libskia_android.so" /data/loc al/tmp
20 fi 20 fi
21 adb_push_if_needed "${SKIA_OUT}/$BUILDTYPE/lib/lib${APP_ARGS[0]}.so" /data/local /tmp 21 adb_push_if_needed "${SKIA_OUT}/$BUILDTYPE/lib/lib${APP_ARGS[0]}.so" /data/local /tmp
22 22
23 STATUS_FILENAME="/data/local/tmp/.skia_tmp_$(date +%s%N)" 23 STATUS_FILENAME="/data/local/tmp/.skia_tmp_$(date +%s%N)"
24 $ADB ${DEVICE_SERIAL} shell \ 24 $ADB ${DEVICE_SERIAL} shell \
25 "/data/local/tmp/skia_launcher ${APP_ARGS[@]}; echo \$? > ${STATUS_FILENAME} " 25 "/data/local/tmp/skia_launcher ${APP_ARGS[@]}; echo \$? > ${STATUS_FILENAME} "
26 if [ -z "$($ADB $DEVICE_SERIAL shell 'if [ -f $STATUS_FILENAME ]; then echo exis ts; fi')" ]; then 26 if [ -z "$($ADB $DEVICE_SERIAL shell 'if [ -f $STATUS_FILENAME ]; then echo exis ts; fi')" ]; then
27 echo "***********************************************************************"
28 echo "The application terminated unexpectedly and did not produce an exit code "
29 echo "***********************************************************************"
27 exit 1 30 exit 1
28 fi 31 fi
32
29 EXIT_CODE=`$ADB ${DEVICE_SERIAL} shell cat ${STATUS_FILENAME}` 33 EXIT_CODE=`$ADB ${DEVICE_SERIAL} shell cat ${STATUS_FILENAME}`
30 $ADB ${DEVICE_SERIAL} shell rm ${STATUS_FILENAME} 34 $ADB ${DEVICE_SERIAL} shell rm -f ${STATUS_FILENAME}
35
36 # check to see if the 'cat' command failed and print errors accordingly
37 if [[ ${EXIT_CODE} == *${STATUS_FILENAME}* ]]; then
38 echo "***********************************************************************"
39 echo "ADB failed to retrieve the application's exit code"
40 echo "***********************************************************************"
41 exit 1
42 fi
43
31 echo "EXIT_CODE is ${EXIT_CODE}" 44 echo "EXIT_CODE is ${EXIT_CODE}"
32 if [ $'0\r' != "${EXIT_CODE}" ]; then 45 if [ $'0\r' != "${EXIT_CODE}" ]; then
33 exit 1 46 exit 1
34 fi 47 fi
35 exit 0 48 exit 0
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698