skia2/tools/skqp
Hal Canary 09609f17cb SkQP: test_apk.sh tool
Also fix the documentation

No-Try: true
Change-Id: I526c2de9d29e64b4a9e1ec3fd9859d72e567ed55
Reviewed-on: https://skia-review.googlesource.com/148992
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-08-23 19:15:18 +00:00
..
jni Revert "Revert "SkTypes: extract SkTo"" 2018-06-14 14:55:17 +00:00
clean_app.sh Test SKQP on Firebase Testlab and Upload 2018-03-07 20:44:50 +00:00
download_model SkQP: download_model complains when files.checksum is missing 2018-02-06 19:48:55 +00:00
generate_gn_args Enable skcms on skqp 2018-05-29 21:38:37 +00:00
gm_knowledge.cpp Replace nearly all kRespect with kIgnore 2018-07-12 20:54:14 +00:00
gm_knowledge.h SkQP: replace blacklist with: DoNotExecuteInExperimentalMode and NoScoreInCompatibilityTestMode 2018-01-22 20:11:57 +00:00
gm_runner.cpp sk_tool::Registry: make an iterator. 2018-08-01 16:59:19 +00:00
gm_runner.h SkQP: replace blacklist with: DoNotExecuteInExperimentalMode and NoScoreInCompatibilityTestMode 2018-01-22 20:11:57 +00:00
gn_to_bp.py Enable skcms on skqp 2018-05-29 21:38:37 +00:00
inflate.py SkQP: add junit app 2017-12-18 18:58:52 +00:00
make_apk_list skqp: update apk list script 2018-05-31 16:46:40 +00:00
make_apk.sh SkQP: Stop requiring users to use posix shell 2018-01-24 21:11:19 +00:00
make_gmkb.go SkQP: remove model slack, README 2018-02-01 15:49:43 +00:00
make_known_tests.sh SkQP: Cloud Scripts 2018-01-23 19:07:11 +00:00
make_model.sh SkQP: Cloud Scripts 2018-01-23 19:07:11 +00:00
make_universal_apk Test SKQP on Firebase Testlab and Upload 2018-03-07 20:44:50 +00:00
README.md SkQP: test_apk.sh tool 2018-08-23 19:15:18 +00:00
remove_unneeded_assets SkQP: Slimmer APKS 2018-02-12 17:05:22 +00:00
run_skqp_exe SkQP: run_skqp_exe script 2018-01-25 16:30:22 +00:00
setup_resources SkQP: remove skia_embed_resources option 2018-01-30 19:24:15 +00:00
skqp_asset_manager.h SkQP: make_gmkb, gm_knowledge (GM Knowledgebase) 2017-12-15 17:23:48 +00:00
skqp.cpp SkQP: remove skia_embed_resources option 2018-01-30 19:24:15 +00:00
sysopen.py SkQP: make_gmkb, gm_knowledge (GM Knowledgebase) 2017-12-15 17:23:48 +00:00
test_apk.sh SkQP: test_apk.sh tool 2018-08-23 19:15:18 +00:00
upload_model SkQP: fix upload/download scripts 2018-01-30 21:40:40 +00:00

SkQP

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.

See https://skia.org/dev/testing/skqp for pre-build APKs.

How to build and run the SkQP tests

  1. Get the dependencies:

    • You will need Java JDK 8, git, and python.

    • Install Chromium's depot_tools. Add it to your PATH.

      git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git'
      export PATH="${PWD}/depot_tools:${PATH}"
      
    • Install the Android NDK.

      ( cd ~; unzip ~/Downloads/android-ndk-*.zip )
      ANDROID_NDK=$(ls -d ~/android-ndk-*)   # Or wherever you installed the Android NDK.
      
    • Install the Android SDK. Set the ANDROID_HOME environment variable.

      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.
      

      Put adb in your PATH.

      export PATH="${PATH}:${ANDROID_HOME}/platform-tools"
      
  2. Get the right version of Skia:

    git clone https://skia.googlesource.com/skia.git
    cd skia
    git checkout origin/skqp/dev  # or whatever release tag you need
    
  3. Download dependencies and the model:

    python tools/skqp/download_model
    python tools/skqp/setup_resources
    python tools/git-sync-deps
    
  4. Configure the build:

    python tools/skqp/generate_gn_args out/skqp-arm "$ANDROID_NDK" \
           --arch arm \
           --api_level 26
    bin/gn gen out/skqp-arm
    

    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.

    platform_tools/android/bin/android_build_app -C out/skqp-arm skqp
    adb install -r out/skqp-arm/skqp.apk
    adb logcat -c
    adb shell am instrument -w org.skia.skqp
    
  6. Monitor the output with:

    adb logcat org.skia.skqp skia "*:S"
    

    Note the test's output path on the device. It will look something like this:

    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"
    
  7. Retrieve and view the report with:

    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
    

Running a single test

To run a single test, for example gles_aarectmodes:

adb shell am instrument -e class 'org.skia.skqp.SkQPRunner#gles_aarectmodes' -w org.skia.skqp

Unit tests can be run with the unitTest_ prefix:

adb shell am instrument -e class 'org.skia.skqp.SkQPRunner#unitTest_GrSurface -w org.skia.skqp

Run as a non-APK executable

  1. Follow steps 1-3 as above.

  2. Build the SkQP program, load files on the device, and run skqp:

    gn gen out/skqp-arm
    ninja -C out/skqp-arm skqp
    python tools/skqp/run_skqp_exe out/skqp-arm