skia2/tools/skqp/test_apk.sh
Hal Canary 5b39dc8153 SkQP: fix model colorspace (16-bit gold images)
Problem: `make_gmkb.go `was ignoring the ignoring the embedded ICC
profile in the images it was getting from Gold.

Replace make_gmkb.go with two small programs: `goldgetter.py` and
`make_skqp_model.cpp`.

`make_skqp_model` uses Skia to create the model from a bunch of images.

`goldgetter` wraps `make_skqp_model` and handles:
  - json parsing
  - downloading images from gold
  - multiprocessing

CQ_INCLUDE_TRYBOTS=skia.primary:Build-Debian9-Clang-x86-devrel-Android_SKQP,Test-Debian9-Clang-NUC7i5BNK-CPU-Emulator-x86-devrel-All-Android_SKQP

Change-Id: I7add1a1dfd83bbd0ab07ab126d4183c36325263c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209101
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-04-17 20:26:39 +00:00

80 lines
1.8 KiB
Bash
Executable File

#! /bin/sh
# Copyright 2018 Google LLC.
# Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
# If you have more than one device attached, run `adb devices -l` and then set
# the ANDROID_SERIAL environment variable to the correct serial number.
APK="$1"
shift
if ! [ -f "$APK" ]; then
cat >&2 <<- EOM
Usage:
$0 SKQP_APK_FILE_PATH [OPTIONAL_TESTS_TO_RUN...]
e.g.:
$0 skqp-universal-debug.apk
or:
$0 skqp-universal-debug.apk vk_hairmodes gles_gammatext gles_aarectmodes
EOM
exit 1
fi
ARGS=''
if [ "$#" -gt 0 ]; then
ARGS="-e class org.skia.skqp.SkQPRunner#${1}"
shift
for arg; do
ARGS="${ARGS},org.skia.skqp.SkQPRunner#${arg}"
done
fi
TDIR="$(mktemp -d "${TMPDIR:-/tmp}/skqp_report.XXXXXXXXXX")"
adb uninstall org.skia.skqp
adb install "$APK" || exit 2
adb logcat -c
adb logcat TestRunner org.skia.skqp skia DEBUG "*:S" | tee "${TDIR}/logcat.txt" &
LOGCAT_PID=$!
ADBSHELL_PID=''
trap 'kill $LOGCAT_PID; kill $ADBSHELL_PID' INT
printf '\n%s\n\n' "adb shell am instrument $ARGS -w org.skia.skqp"
adb shell am instrument $ARGS -w org.skia.skqp \
> "${TDIR}/stdout.txt" \
2> "${TDIR}/stderr.txt" &
ADBSHELL_PID=$!
wait $ADBSHELL_PID
trap - INT
kill $LOGCAT_PID
printf '\nTEST OUTPUT IS IN: "%s"\n\n' "$TDIR"
SED_CMD='s/^.* org.skia.skqp: output written to "\([^"]*\)".*$/\1/p'
ODIR="$(sed -n "$SED_CMD" "${TDIR}/logcat.txt" | head -1)"
if ! adb shell "test -d '$ODIR'" ; then
echo 'missing output :('
exit 3
fi
odir_basename="$(basename "$ODIR")"
adb pull "${ODIR}" "${TDIR}/${odir_basename}"
REPORT="${TDIR}/${odir_basename}/report.html"
if [ -f "$REPORT" ]; then
grep 'f(.*;' "$REPORT"
echo "$REPORT"
"$(dirname "$0")"/../../bin/sysopen "$REPORT" > /dev/null 2>&1 &
else
echo "$TDIR"
fi