summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTobrun Van Nuland <tobrun.van.nuland@gmail.com>2017-09-21 07:26:24 +0200
committerTobrun <tobrun@mapbox.com>2018-06-01 20:05:56 +0200
commitbe66de6fcda643872311b21ba8fd5abc8302fc3e (patch)
tree4708e4aa4a57f6ba0bfb77fa9cd03832d7006d0e /Makefile
parenta721b74b87e51d17c5712fe947f56515c77defba (diff)
downloadqtlocation-mapboxgl-be66de6fcda643872311b21ba8fd5abc8302fc3e.tar.gz
[android] - Render tests with PixelMatch
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c2daa617b4..8ba8084412 100644
--- a/Makefile
+++ b/Makefile
@@ -588,6 +588,22 @@ run-android-ui-test-$1-%: platform/android/gradle/configuration.gradle
android-ndk-stack-$1: platform/android/gradle/configuration.gradle
adb logcat | ndk-stack -sym platform/android/MapboxGLAndroidSDK/build/intermediates/cmake/debug/obj/$2/
+# Run render tests with pixelmatch
+.PHONY: run-android-render-test-$1
+run-android-render-test-$1: $(BUILD_DEPS) platform/android/gradle/configuration.gradle
+ -adb uninstall com.mapbox.mapboxsdk.testapp 2> /dev/null
+ # delete old test results
+ rm -rf platform/android/build/render-test/mapbox/
+ # copy test definitions to test app assets folder, clear old ones first
+ rm -rf platform/android/MapboxGLAndroidSDKTestApp/src/main/assets/integration
+ cp -r mapbox-gl-js/test/integration platform/android/MapboxGLAndroidSDKTestApp/src/main/assets
+ # run RenderTest.java to generate static map images
+ cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="com.mapbox.mapboxsdk.testapp.render.RenderTest"
+ # pull generated images from the device
+ adb pull "`adb shell 'printenv EXTERNAL_STORAGE' | tr -d '\r'`/mapbox/render" platform/android/build/render-test
+ # copy expected result and run pixelmatch
+ python platform/android/scripts/run-render-test.py
+
endef
# Explodes the arguments into individual variables