2012-07-18 10:36:07 +00: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 08:00:06 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2012-07-18 10:36:07 +00:00
|
|
|
import string
|
|
|
|
|
2013-10-07 18:56:52 +00:00
|
|
|
manifest_template = """# THIS FILE IS AUTOGENERATED BY ${caller} - DO NOT EDIT
|
|
|
|
[DEFAULT]
|
|
|
|
support-files =
|
|
|
|
${supportfiles}
|
|
|
|
|
|
|
|
${tests}
|
|
|
|
"""
|
|
|
|
|
2013-05-10 07:12:48 +00:00
|
|
|
reftest_template = """# THIS FILE IS AUTOGENERATED BY ${caller} - DO NOT EDIT
|
|
|
|
|
|
|
|
${reftests}
|
|
|
|
"""
|
|
|
|
|
2013-02-25 20:46:50 +00:00
|
|
|
|
|
|
|
|
2013-10-07 18:56:52 +00: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 07:12:48 +00: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),
|
|
|
|
})
|
|
|
|
|