Bug 1277424 - Update wrapper generator to skip WebGL2 testing for linux and Android, r?jgilbert
MozReview-Commit-ID: GmyvaxYlWZr
--- a/dom/canvas/test/webgl-conf/generate-wrappers-and-manifest.py
+++ b/dom/canvas/test/webgl-conf/generate-wrappers-and-manifest.py
@@ -4,27 +4,27 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Write a Mochitest manifest for WebGL conformance test files.
import os
import re
-CURRENT_VERSION = '1.0.3'
-
# All paths in this file are based where this file is run.
WRAPPER_TEMPLATE_FILE = 'mochi-wrapper.html.template'
MANIFEST_TEMPLATE_FILE = 'mochitest.ini.template'
ERRATA_FILE = 'mochitest-errata.ini'
DEST_MANIFEST_PATHSTR = 'generated-mochitest.ini'
BASE_TEST_LIST_PATHSTR = 'checkout/00_test_list.txt'
GENERATED_PATHSTR = 'generated'
+WEBGL2_TEST_MANGLE = '2_'
PATH_SEP_MANGLING = '__'
+WEBGL2_SKIP_IF_CONDITION = "(os == 'android' || os == 'linux')"
SUPPORT_DIRS = [
'checkout',
]
EXTRA_SUPPORT_FILES = [
'always-fail.html',
'iframe-passthrough.css',
@@ -279,40 +279,48 @@ class TemplateShell:
indentLen += len(span)
continue
return ret
########################################################################
# Output
+def IsWrapperWebGL2(wrapperPath):
+ return wrapperPath.startswith(GENERATED_PATHSTR + '/test_' + WEBGL2_TEST_MANGLE)
+
+
def WriteWrapper(entryPath, webgl2, templateShell, wrapperPathAccum):
mangledPath = entryPath.replace('/', PATH_SEP_MANGLING)
- maybeWebGL2 = ''
+ maybeWebGL2Mangle = ''
if webgl2:
- maybeWebGL2 = '2_'
+ maybeWebGL2Mangle = WEBGL2_TEST_MANGLE
# Mochitests must start with 'test_' or similar, or the test
# runner will ignore our tests.
# The error text is "is not a valid test".
- wrapperFileName = 'test_{}{}'.format(maybeWebGL2, mangledPath)
+ wrapperFileName = 'test_' + maybeWebGL2Mangle + mangledPath
wrapperPath = GENERATED_PATHSTR + '/' + wrapperFileName
print('Adding wrapper: ' + wrapperPath)
args = ''
if webgl2:
args = '?webglVersion=2'
templateDict = {
'TEST_PATH': entryPath,
'ARGS': args,
}
OutputFilledTemplate(templateShell, templateDict, wrapperPath)
+
+ if webgl2:
+ assert IsWrapperWebGL2(wrapperPath)
+
wrapperPathAccum.append(wrapperPath)
return
def WriteWrappers(testEntryList):
templateShell = ImportTemplate(WRAPPER_TEMPLATE_FILE)
generatedDirPath = GENERATED_PATHSTR.replace('/', os.sep)
@@ -366,20 +374,33 @@ def WriteManifest(wrapperPathStrList, su
wrapperPathStrList = sorted(wrapperPathStrList)
for wrapperPathStr in wrapperPathStrList:
#print 'wrapperPathStr: ' + wrapperPathStr
wrapperManifestPathStr = ManifestPathStr(wrapperPathStr)
sectionName = '[' + wrapperManifestPathStr + ']'
manifestTestLineList.append(sectionName)
+ errataLines = []
if wrapperPathStr in errataMap:
- manifestTestLineList += errataMap[wrapperPathStr]
+ errataLines = errataMap[wrapperPathStr]
del errataMap[wrapperPathStr]
+ if IsWrapperWebGL2(wrapperPathStr):
+ needsSkip = True
+ for i in range(len(errataLines)):
+ if errataLines[i].startswith('skip-if'):
+ errataLines[i] += ' || ' + WEBGL2_SKIP_IF_CONDITION
+ needsSkip = False
+ continue
+
+ if needsSkip:
+ errataLines.append('skip-if = ' + WEBGL2_SKIP_IF_CONDITION)
+
+ manifestTestLineList += errataLines
continue
if errataMap:
print 'Errata left in map:'
for x in errataMap.keys():
print ' '*4 + x
assert False