1#! /bin/sh 2# Copyright 2019 Google LLC. 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6# Notes: 7# 8# You may need to run as root for docker permissions. 9# 10# The SKQP_ARGS environment variable affects this script. 11 12if ! [ -f "$1" ] ; then 13 echo "Usage: $0 SKQP_APK_FILE_PATH" >&2 14 exit 1 15fi 16 17APK_DIR="$(cd "$(dirname "$1")"; pwd)" 18APK_FILE="$(basename "$1")" 19DST="$(mktemp -d "${TMPDIR:-/tmp}/skqp_emulated_test.XXXXXXXXXX")" 20SED_CMD='s/^.* org.skia.skqp: output written to "\([^"]*\)".*$/\1/p' 21SKQP="$(cd $(dirname "$0"); pwd)" 22 23set -x 24 25cd "${SKQP}/../../infra/skqp/docker" 26 27docker build -t android-skqp ./android-skqp/ > "$DST"/docker-build || exit 2 28 29docker run --privileged --rm -d \ 30 --name android_em \ 31 --env=DEVICE="Samsung Galaxy S6" \ 32 --env=SKQP_SLEEP="30" \ 33 --env=SKQP_ARGS="$SKQP_ARGS" \ 34 --volume="$DST":/DST \ 35 --volume="$APK_DIR":/APK:ro \ 36 --volume="$SKQP":/SKQP:ro \ 37 android-skqp > "$DST"/docker-run || exit 3 38 39docker exec android_em sh "/SKQP/run_apk.sh" "/APK/$APK_FILE" "/DST" 40 41docker kill android_em 42 43"${SKQP}/../../bin/sysopen" "$DST"/skqp_report_*/report.html 44