Make import-tests.py generate the current state of the reftest manifest, and warn that the file is autogenerated. (Bug 817810) No review.

This commit is contained in:
L. David Baron 2012-12-04 03:08:59 -08:00
parent 6a556e741a
commit a2139e12c8
2 changed files with 18 additions and 1 deletions

View File

@ -48,6 +48,10 @@ gPrefixedProperties = [
"column-width"
]
gDefaultPreferences = {
"css3-conditional": "pref(layout.css.supports-rule.enabled,true)"
}
gLog = None
gFailList = {}
gDestPath = None
@ -244,6 +248,8 @@ def read_options():
def setup_paths():
global gSubtrees, gDestPath, gSrcPath
# FIXME: generate gSrcPath with consistent trailing / regardless of input.
# (We currently expect the argument to have a trailing slash.)
gSrcPath = gArgs[0]
if not os.path.isdir(gSrcPath) or \
not os.path.isdir(os.path.join(gSrcPath, ".hg")):
@ -284,10 +290,19 @@ def main():
add_test_items(t, spec=None)
listfile = open(os.path.join(gDestPath, "reftest.list"), "w")
listfile.write("# THIS FILE IS AUTOGENERATED BY {0}\n# DO NOT EDIT!\n".format(os.path.basename(__file__)))
lastDefaultPreferences = None
for test in tests:
defaultPreferences = gDefaultPreferences.get(test[1].split("/")[0], None)
if defaultPreferences != lastDefaultPreferences:
if defaultPreferences is None:
listfile.write("\ndefault-preferences\n\n")
else:
listfile.write("\ndefault-preferences {0}\n\n".format(defaultPreferences))
lastDefaultPreferences = defaultPreferences
key = 0
while not test[key] in gTestFlags.keys() and key < len(test):
key = key + 1
key = key + 1
testKey = test[key]
if 'ahem' in gTestFlags[testKey]:
test = ["HTTP(../../..)"] + test

View File

@ -1,3 +1,5 @@
# THIS FILE IS AUTOGENERATED BY import-tests.py
# DO NOT EDIT!
== css3-namespace/prefix-001.xml css3-namespace/ref-lime-1.xml
== css3-namespace/prefix-002.xml css3-namespace/ref-lime-1.xml
== css3-namespace/prefix-003.xml css3-namespace/ref-lime-1-generic.xml