2012-07-18 03:36:07 -07:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# 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/.
|
|
|
|
|
2012-11-04 01:00:06 -07:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2012-07-18 03:36:07 -07:00
|
|
|
import string
|
|
|
|
|
2013-10-07 11:56:52 -07:00
|
|
|
manifest_template = """# THIS FILE IS AUTOGENERATED BY ${caller} - DO NOT EDIT
|
|
|
|
[DEFAULT]
|
|
|
|
support-files =
|
|
|
|
${supportfiles}
|
|
|
|
|
|
|
|
${tests}
|
|
|
|
"""
|
|
|
|
|
2013-05-10 00:12:48 -07:00
|
|
|
reftest_template = """# THIS FILE IS AUTOGENERATED BY ${caller} - DO NOT EDIT
|
|
|
|
|
|
|
|
${reftests}
|
|
|
|
"""
|
|
|
|
|
2013-02-25 12:46:50 -08:00
|
|
|
|
|
|
|
|
2013-10-07 11:56:52 -07:00
|
|
|
def substManifest(caller, test_files, support_files):
|
|
|
|
test_files = [f.lstrip('/') for f in test_files]
|
|
|
|
support_files = [f.lstrip('/') for f in support_files]
|
|
|
|
|
|
|
|
return string.Template(manifest_template).substitute({
|
|
|
|
'caller': caller,
|
|
|
|
'supportfiles': '\n'.join(' %s' % f for f in sorted(support_files)),
|
|
|
|
'tests': '\n'.join('[%s]' % f for f in sorted(test_files))
|
|
|
|
})
|
|
|
|
|
|
|
|
|
2013-05-10 00:12:48 -07:00
|
|
|
def substReftestList(caller, tests):
|
|
|
|
def reftests(tests):
|
|
|
|
return "\n".join(" ".join(line) for line in tests)
|
|
|
|
|
|
|
|
return string.Template(reftest_template).substitute({
|
|
|
|
"caller": caller,
|
|
|
|
"reftests": reftests(tests),
|
|
|
|
})
|
|
|
|
|