summaryrefslogtreecommitdiff
path: root/platform/android/scripts/run-render-test.py
blob: 83376256a4a3281972693d686b2277a60a19c95e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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