[android] - show amount failed tests and executed tests, integrate pixelratio in tests
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import os
|
||||
from shutil import copyfile
|
||||
import shutil
|
||||
|
||||
catPath = os.getcwd() + "/platform/android/build/render-test/render/"
|
||||
failCounter = 0
|
||||
testCounter = 0
|
||||
for cat in os.listdir(catPath):
|
||||
testPath = catPath + cat + "/"
|
||||
for test in os.listdir(testPath):
|
||||
@@ -14,11 +16,28 @@ for cat in os.listdir(catPath):
|
||||
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"
|
||||
shutil.copyfile(inputPath + "/expected.png", expected)
|
||||
shutil.copyfile(inputPath + "/style.json", outputPath + "/style.json")
|
||||
pixelmatchCommand = "node_modules/pixelmatch/bin/pixelmatch " + actual + " " + expected + " " + output + " 0.1"
|
||||
|
||||
print
|
||||
print "Pixel match "+ cat + " " + test
|
||||
os.system(pixelmatch)
|
||||
print "Pixel match " + cat + " " + test
|
||||
|
||||
with os.popen(pixelmatchCommand) as f:
|
||||
for line_terminated in f:
|
||||
line = line_terminated.rstrip('\n')
|
||||
pair = line.split(": ")
|
||||
if pair[0] == "error":
|
||||
testCounter += 1
|
||||
currentError = pair[1]
|
||||
if currentError != "0%":
|
||||
failCounter += 1
|
||||
# below deletes successful results
|
||||
# print cat + " " + test + " " + currentError
|
||||
# else:
|
||||
# try:
|
||||
# if os.path.isdir(outputPath):
|
||||
# shutil.rmtree(outputPath)
|
||||
# except OSError, e:
|
||||
# print ("Error: %s - %s." % (e.filename, e.strerror))
|
||||
print
|
||||
print str(failCounter) + "/" + str(testCounter)
|
||||
|
||||
Reference in New Issue
Block a user