2a7f0aa9eb
* Generate report in app after running all tests. * Add script to unpack backup.ab file. * Remove unused index file. * Streamline instructions in README.md. Change-Id: I44c80b17332eb4496ee31578287b691bd646d71a Reviewed-on: https://skia-review.googlesource.com/86742 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Hal Canary <halcanary@google.com>
2.4 KiB
2.4 KiB
SkQP
Motivation: Test an Android device’s GPU and OpenGLES & Vulkan drivers with Skia and Skia’s existing unit & rendering tests.
How To Use SkQP on your Android device:
-
To build SkQP you need to install the Android NDK.
-
Checkout Skia, then go to the source directory:
cd $SKIA_SOURCE_DIRECTORY
-
Configure and build Skia for your device's architecture:
arch='arm64' # Also valid: 'arm', 'x68', 'x64' android_ndk="${HOME}/ndk" # Or wherever you installed the NDK. mkdir -p out/${arch}-rel cat > out/${arch}-rel/args.gn << EOF ndk = "$android_ndk" ndk_api = 24 target_cpu = "$arch" skia_embed_resources = true is_debug = false EOF tools/git-sync-deps bin/gn gen out/${arch}-rel ninja -C out/${arch}-rel skqp_lib
-
Download meta.json from https://goo.gl/jBw3Dd . This is the data used to build the validation model.
-
Generate the validation model data:
go get go.skia.org/infra/golden/go/search go run tools/skqp/make_gmkb.go ~/Downloads/meta.json \ platform_tools/android/apps/skqp/src/main/assets/gmkb
Run as an executable
-
Build the SkQP program, load files on the device, and run skqp:
ninja -C out/${arch}-rel skqp adb shell "cd /data/local/tmp; rm -rf gmkb report" adb push platform_tools/android/apps/skqp/src/main/assets/gmkb \ /data/local/tmp/ adb push out/${arch}-rel/skqp /data/local/tmp/ adb shell "cd /data/local/tmp; ./skqp gmkb report"
-
Get the error report if there are errors:
if adb shell test -d /data/local/tmp/report; then adb pull /data/local/tmp/report /tmp/ tools/skqp/sysopen.py /tmp/report/report.html fi
Run as an APK
-
Build the skqp.apk, load it on the device, and run the tests
platform_tools/android/bin/android_build_app -C out/${arch}-rel skqp adb install -r out/${arch}-rel/skqp.apk adb shell am instrument -w \ org.skia.skqp/android.support.test.runner.AndroidJUnitRunner
-
Retrieve the report if there are any errors:
adb backup -f /tmp/skqp.ab org.skia.skqp # Must unlock phone and verify backup. tools/skqp/extract_report.py /tmp/skqp.ab