Xiaoming Shi | 73dfa20 | 2020-03-12 11:31:35 -0700 | [diff] [blame] | 1 | SkQP |
| 2 | ==== |
| 3 | |
| 4 | SkQP (Skia Quality Program) is a component of the Android CTS (Compatablity |
| 5 | Test Suite) that tests an Android device's GPU and OpenGLES & Vulkan drivers |
| 6 | using Skia's existing unit & rendering tests. |
| 7 | |
| 8 | See https://skia.org/dev/testing/skqp for pre-build APKs. |
| 9 | |
| 10 | How to build and run the SkQP tests |
| 11 | ----------------------------------- |
| 12 | |
| 13 | 1. Get the dependencies: |
| 14 | |
| 15 | - You will need Java JDK 8, `git`, and `python`. |
| 16 | |
| 17 | - 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`. |
| 18 | |
| 19 | git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' |
| 20 | export PATH="${PWD}/depot_tools:${PATH}" |
| 21 | |
| 22 | - Install the [Android NDK](https://developer.android.com/ndk/downloads/). |
| 23 | |
| 24 | ( cd ~; unzip ~/Downloads/android-ndk-*.zip ) |
| 25 | ANDROID_NDK=$(ls -d ~/android-ndk-*) # Or wherever you installed the Android NDK. |
| 26 | |
| 27 | - Install the [Android SDK](https://developer.android.com/studio/#command-tools). |
| 28 | Set the `ANDROID_HOME` environment variable. |
| 29 | |
| 30 | mkdir ~/android-sdk |
| 31 | ( cd ~/android-sdk; unzip ~/Downloads/sdk-tools-*.zip ) |
| 32 | yes | ~/android-sdk/tools/bin/sdkmanager --licenses |
| 33 | export ANDROID_HOME=~/android-sdk # Or wherever you installed the Android SDK. |
| 34 | |
| 35 | Put `adb` in your `PATH`. |
| 36 | |
| 37 | export PATH="${PATH}:${ANDROID_HOME}/platform-tools" |
| 38 | |
| 39 | 2. Get the right version of Skia: |
| 40 | |
| 41 | git clone https://skia.googlesource.com/skia.git |
| 42 | cd skia |
| 43 | git checkout origin/skqp/dev # or whatever release tag you need |
| 44 | |
| 45 | 3. Build the APK: |
| 46 | |
| 47 | tools/git-sync-deps |
| 48 | tools/skqp/make_universal_apk |
| 49 | |
| 50 | 4. Build, install, and run. |
| 51 | |
| 52 | adb install -r out/skqp/skqp-universal-debug.apk |
| 53 | adb logcat -c |
| 54 | adb shell am instrument -w org.skia.skqp |
| 55 | |
| 56 | 5. Monitor the output with: |
| 57 | |
| 58 | adb logcat TestRunner org.skia.skqp skia "*:S" |
| 59 | |
| 60 | Note the test's output path on the device. It will look something like this: |
| 61 | |
| 62 | 01-23 15:22:12.688 27158 27173 I org.skia.skqp: |
| 63 | output written to "/storage/emulated/0/Android/data/org.skia.skqp/files/output" |
| 64 | |
| 65 | 6. Retrieve and view the report with: |
| 66 | |
| 67 | OUTPUT_LOCATION="/storage/emulated/0/Android/data/org.skia.skqp/files/output" |
| 68 | adb pull $OUTPUT_LOCATION /tmp/ |
| 69 | bin/sysopen /tmp/output/skqp_report/report.html |
| 70 | |
| 71 | Running a single test |
| 72 | --------------------- |
| 73 | |
| 74 | To run a single test, for example `gles_aarectmodes`: |
| 75 | |
| 76 | adb shell am instrument -e class 'org.skia.skqp.SkQPRunner#gles_aarectmodes' -w org.skia.skqp |
| 77 | |
| 78 | Unit tests can be run with the `unitTest_` prefix: |
| 79 | |
| 80 | adb shell am instrument -e class 'org.skia.skqp.SkQPRunner#unitTest_GrSurface -w org.skia.skqp |
| 81 | |
| 82 | Run as a non-APK executable |
| 83 | --------------------------- |
| 84 | |
| 85 | 1. Follow steps 1-3 as above. |
| 86 | |
| 87 | 2. Build the SkQP program, load files on the device, and run skqp: |
| 88 | |
| 89 | gn gen out/skqp-arm |
| 90 | ninja -C out/skqp-arm skqp |
| 91 | python tools/skqp/run_skqp_exe out/skqp-arm |
| 92 | |