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

Unified 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, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: platform_tools/android/bin/android_run_skia
diff --git a/platform_tools/android/bin/android_run_skia b/platform_tools/android/bin/android_run_skia
index ebcc041c2d74f2b5ffc3b0abc476a933b399e508..7bc9671b89f3b001f385a3cb5e0fc925c8b20c74 100755
--- a/platform_tools/android/bin/android_run_skia
+++ b/platform_tools/android/bin/android_run_skia
@@ -24,10 +24,23 @@ STATUS_FILENAME="/data/local/tmp/.skia_tmp_$(date +%s%N)"
$ADB ${DEVICE_SERIAL} shell \
"/data/local/tmp/skia_launcher ${APP_ARGS[@]}; echo \$? > ${STATUS_FILENAME}"
if [ -z "$($ADB $DEVICE_SERIAL shell 'if [ -f $STATUS_FILENAME ]; then echo exists; fi')" ]; then
+ echo "***********************************************************************"
+ echo "The application terminated unexpectedly and did not produce an exit code"
+ echo "***********************************************************************"
exit 1
fi
+
EXIT_CODE=`$ADB ${DEVICE_SERIAL} shell cat ${STATUS_FILENAME}`
-$ADB ${DEVICE_SERIAL} shell rm ${STATUS_FILENAME}
+$ADB ${DEVICE_SERIAL} shell rm -f ${STATUS_FILENAME}
+
+# check to see if the 'cat' command failed and print errors accordingly
+if [[ ${EXIT_CODE} == *${STATUS_FILENAME}* ]]; then
+ echo "***********************************************************************"
+ echo "ADB failed to retrieve the application's exit code"
+ echo "***********************************************************************"
+ exit 1
+fi
+
echo "EXIT_CODE is ${EXIT_CODE}"
if [ $'0\r' != "${EXIT_CODE}" ]; then
exit 1
« 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