[android] - Render tests with PixelMatch

This commit is contained in:
Tobrun Van Nuland
2017-09-21 07:26:24 +02:00
committed by Tobrun
parent a721b74b87
commit be66de6fcd
16 changed files with 821 additions and 54 deletions

View File

@@ -34,5 +34,6 @@
"ZoomFunctionSymbolLayerActivity",
"SymbolGeneratorActivity",
"TextureViewTransparentBackgroundActivity",
"SimpleMapActivity"
"SimpleMapActivity",
"RenderTestActivity"
]

View File

@@ -0,0 +1,24 @@
#!/usr/bin/python
import os
from shutil import copyfile
catPath = os.getcwd() + "/platform/android/build/render-test/render/"
for cat in os.listdir(catPath):
testPath = catPath + cat + "/"
for test in os.listdir(testPath):
inputPath = os.getcwd() + "/mapbox-gl-js/test/integration/render-tests/" + cat + "/" + test
outputPath = testPath + test
expected = outputPath + "/expected.png"
actual = outputPath + "/actual.png"
output = outputPath + "/output.png"
copyfile(inputPath + "/expected.png", expected)
copyfile(inputPath + "/style.json", outputPath + "/style.json")
pixelmatch = "node_modules/pixelmatch/bin/pixelmatch " + actual + " " + expected + " " + output + " 0.1"
print
print "Pixel match "+ cat + " " + test
os.system(pixelmatch)
print