662af29307
(SkipBuildbotRuns) BUG=skia:2313 NOTREECHECKS=True NOTRY=True R=borenet@google.com Author: epoger@google.com Review URL: https://codereview.chromium.org/204713003 git-svn-id: http://skia.googlecode.com/svn/trunk@13881 2bbb7eff-a529-9590-31e7-b0007b416f81
49 lines
1.5 KiB
Bash
Executable File
49 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# android_run_skia: starts the correct skia program on the device, prints the
|
|
# output, and kills the app if interrupted.
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
source $SCRIPT_DIR/android_setup.sh
|
|
source $SCRIPT_DIR/utils/setup_adb.sh
|
|
|
|
configuration="Debug"
|
|
|
|
for arg in ${APP_ARGS[@]}
|
|
do
|
|
if [[ "${arg}" == "--release" ]];
|
|
then
|
|
configuration="Release"
|
|
else
|
|
runVars=("${runVars[@]}" "${arg}")
|
|
fi
|
|
|
|
shift
|
|
done
|
|
|
|
if [ ! -f "${SKIA_OUT}/${configuration}/lib.target/lib${runVars[0]}.so" ];
|
|
then
|
|
echo "Unable to find the ${runVars[0]} library"
|
|
exit 1
|
|
fi
|
|
|
|
adb_push_if_needed "${SKIA_OUT}/${configuration}/skia_launcher" /data/local/tmp
|
|
if [ -f "${SKIA_OUT}/${configuration}/lib.target/libskia_android.so" ]; then
|
|
# Does not exist for builds with static skia.
|
|
adb_push_if_needed "${SKIA_OUT}/${configuration}/lib.target/libskia_android.so" /data/local/tmp
|
|
fi
|
|
adb_push_if_needed "${SKIA_OUT}/${configuration}/lib.target/lib${runVars[0]}.so" /data/local/tmp
|
|
|
|
STATUS_FILENAME="/data/local/tmp/.skia_tmp_$(date +%s%N)"
|
|
$ADB ${DEVICE_SERIAL} shell "/data/local/tmp/skia_launcher ${runVars[@]}; echo \$? > ${STATUS_FILENAME}"
|
|
if [ -z "$($ADB $DEVICE_SERIAL shell 'if [ -f $STATUS_FILENAME ]; then echo exists; fi')" ]; then
|
|
exit 1
|
|
fi
|
|
EXIT_CODE=`$ADB ${DEVICE_SERIAL} shell cat ${STATUS_FILENAME}`
|
|
$ADB ${DEVICE_SERIAL} shell rm ${STATUS_FILENAME}
|
|
echo "EXIT_CODE is [${EXIT_CODE}]"
|
|
if [ $'0\r' != "${EXIT_CODE}" ]; then
|
|
exit 1
|
|
fi
|
|
exit 0
|