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