Bug 1277424 - Update wrapper generator to skip WebGL2 testing for linux and Android, r=jgilbert

MozReview-Commit-ID: GmyvaxYlWZr

--HG--
extra : rebase_source : a85edab38cadc702fb70e4505e38f080b164a07e
This commit is contained in:
peter chang 2016-07-07 12:15:11 +08:00
parent b46b589aee
commit d73005c87e

View File

@ -9,8 +9,6 @@
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'
@ -19,7 +17,9 @@ 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',
@ -284,16 +284,20 @@ class TemplateShell:
########################################################################
# 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)
@ -308,6 +312,10 @@ def WriteWrapper(entryPath, webgl2, templateShell, wrapperPathAccum):
}
OutputFilledTemplate(templateShell, templateDict, wrapperPath)
if webgl2:
assert IsWrapperWebGL2(wrapperPath)
wrapperPathAccum.append(wrapperPath)
return
@ -371,10 +379,23 @@ def WriteManifest(wrapperPathStrList, supportPathStrList):
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: