2017-12-11 22:46:26 +00:00
SkQP
====
2018-02-01 15:41:20 +00:00
SkQP (Skia Quality Program) is a component of the Android CTS (Compatablity
Test Suite) that tests an Android device's GPU and OpenGLES & Vulkan drivers
using Skia's existing unit & rendering tests.
2018-02-20 17:37:49 +00:00
See https://skia.org/dev/testing/skqp for pre-build APKs.
How to build and run the SkQP tests
-----------------------------------
2017-12-11 22:46:26 +00:00
2018-02-01 15:41:20 +00:00
1. Get the dependencies:
2018-02-01 20:12:16 +00:00
- You will need Java JDK 8, `git` , and `python` .
2018-02-01 15:41:20 +00:00
- Install Chromium's [depot\_tools ](http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html ). Add it to your `PATH` .
git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git'
export PATH="${PWD}/depot_tools:${PATH}"
2017-12-11 22:46:26 +00:00
2018-02-01 15:41:20 +00:00
- Install the [Android NDK ](https://developer.android.com/ndk/downloads/ ).
2017-12-11 22:46:26 +00:00
2018-02-01 15:41:20 +00:00
( cd ~; unzip ~/Downloads/android-ndk-*.zip )
2018-02-20 17:37:49 +00:00
ANDROID_NDK=$(ls -d ~/android-ndk-*) # Or wherever you installed the Android NDK.
2017-12-11 22:46:26 +00:00
2018-02-01 15:41:20 +00:00
- Install the [Android SDK ](https://developer.android.com/studio/#command-tools ).
Set the `ANDROID_HOME` environment variable.
2017-12-11 22:46:26 +00:00
2018-02-01 15:41:20 +00:00
mkdir ~/android-sdk
( cd ~/android-sdk; unzip ~/Downloads/sdk-tools-*.zip )
yes | ~/android-sdk/tools/bin/sdkmanager --licenses
export ANDROID_HOME=~/android-sdk # Or wherever you installed the Android SDK.
2017-12-11 22:46:26 +00:00
2018-02-01 15:41:20 +00:00
Put `adb` in your `PATH` .
2017-12-11 22:46:26 +00:00
2018-02-01 15:41:20 +00:00
export PATH="${PATH}:${ANDROID_HOME}/platform-tools"
2018-01-25 16:30:05 +00:00
2018-02-01 15:41:20 +00:00
2. Get the right version of Skia:
2017-12-11 22:46:26 +00:00
2018-01-24 18:42:38 +00:00
git clone https://skia.googlesource.com/skia.git
cd skia
2018-01-25 15:01:01 +00:00
git checkout origin/skqp/dev # or whatever release tag you need
2017-12-11 22:46:26 +00:00
2018-02-02 20:05:42 +00:00
3. Download dependencies and the model:
2017-12-11 22:46:26 +00:00
2018-01-24 18:42:38 +00:00
python tools/skqp/download_model
2018-01-30 16:30:48 +00:00
python tools/skqp/setup_resources
2018-01-24 18:42:38 +00:00
python tools/git-sync-deps
2018-02-02 20:05:42 +00:00
4. Configure the build:
python tools/skqp/generate_gn_args out/skqp-arm "$ANDROID_NDK" \
--arch arm \
--api_level 26
2018-01-24 18:42:38 +00:00
bin/gn gen out/skqp-arm
2017-12-11 22:46:26 +00:00
2018-02-02 20:05:42 +00:00
If you want to test another architecture, replace `arm` with `x86` , `x64`
or `arm64` . Run 'python tools/skqp/generate_gn_args -h' for
all options.
5. Build, install, and run.
2017-12-11 22:46:26 +00:00
2018-01-24 18:42:38 +00:00
platform_tools/android/bin/android_build_app -C out/skqp-arm skqp
adb install -r out/skqp-arm/skqp.apk
adb logcat -c
2018-02-20 19:48:40 +00:00
adb shell am instrument -w org.skia.skqp
2017-12-11 22:46:26 +00:00
2018-02-02 20:05:42 +00:00
6. Monitor the output with:
2017-12-11 22:46:26 +00:00
2018-01-24 18:42:38 +00:00
adb logcat org.skia.skqp skia "*:S"
2017-12-11 22:46:26 +00:00
2018-01-24 18:42:38 +00:00
Note the test's output path on the device. It will look something like this:
2017-12-21 20:13:20 +00:00
2018-01-24 18:42:38 +00:00
01-23 15:22:12.688 27158 27173 I org.skia.skqp:
output written to "/storage/emulated/0/Android/data/org.skia.skqp/files/output"
2017-12-21 20:13:20 +00:00
2018-02-02 20:05:42 +00:00
7. Retrieve and view the report with:
2017-12-12 14:42:14 +00:00
2018-01-24 18:42:38 +00:00
OUTPUT_LOCATION="/storage/emulated/0/Android/data/org.skia.skqp/files/output"
adb pull $OUTPUT_LOCATION /tmp/
tools/skqp/sysopen.py /tmp/output/skqp_report/report.html
2017-12-12 14:42:14 +00:00
2018-02-20 19:48:40 +00:00
Running a single test
---------------------
2018-08-23 18:50:07 +00:00
To run a single test, for example `gles_aarectmodes` :
2018-02-20 19:48:40 +00:00
2018-08-23 18:50:07 +00:00
adb shell am instrument -e class 'org.skia.skqp.SkQPRunner#gles_aarectmodes' -w org.skia.skqp
2018-02-20 19:48:40 +00:00
2018-08-23 18:50:07 +00:00
Unit tests can be run with the `unitTest_` prefix:
2018-02-20 19:48:40 +00:00
2018-08-23 18:50:07 +00:00
adb shell am instrument -e class 'org.skia.skqp.SkQPRunner#unitTest_GrSurface -w org.skia.skqp
2018-02-20 19:48:40 +00:00
2018-01-25 15:01:01 +00:00
Run as a non-APK executable
---------------------------
2018-01-19 18:08:23 +00:00
2018-02-01 15:41:20 +00:00
1. Follow steps 1-3 as above.
2018-01-19 18:08:23 +00:00
2018-01-24 18:42:38 +00:00
2. Build the SkQP program, load files on the device, and run skqp:
2018-01-19 18:08:23 +00:00
2018-03-20 18:09:32 +00:00
gn gen out/skqp-arm
2018-01-24 18:42:38 +00:00
ninja -C out/skqp-arm skqp
2018-01-25 16:30:05 +00:00
python tools/skqp/run_skqp_exe out/skqp-arm
2017-12-12 14:42:14 +00:00