Bug 1341502: Fix automatic regeneration of backend when an included test manifest changes. r=mshal

MozReview-Commit-ID: 1ZQNQpqboz9

--HG--
extra : rebase_source : 6e5a4f6f037d00ea59a28d392060059f1b38b365
This commit is contained in:
Kris Maglione 2017-02-21 17:31:21 -08:00
parent 164d6cbbee
commit a46cc7117e
7 changed files with 31 additions and 0 deletions

View File

@ -32,6 +32,9 @@ class TestManifestBackend(PartialBackend):
self.backend_input_files.add(obj.path)
self.backend_input_files |= obj.context_all_paths
for source in obj.source_relpaths:
self.backend_input_files.add(mozpath.join(obj.topsrcdir,
source))
try:
from reftest import ReftestManifest

View File

@ -0,0 +1,2 @@
[test_foo.js]
[include:mochitest-common.ini]

View File

@ -0,0 +1,6 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
MOCHITEST_MANIFESTS += [
'mochitest.ini',
]

View File

@ -68,6 +68,25 @@ class TestTestManifestBackend(BackendTester):
self.assertIn('here', o[manifest_path])
self.assertIn('support-files', o[manifest_path])
def test_test_manifest_sources(self):
"""Ensure that backend sources are generated correctly."""
env = self._consume('test-manifests-backend-sources', TestManifestBackend)
backend_path = mozpath.join(env.topobjdir, 'backend.TestManifestBackend.in')
self.assertTrue(os.path.exists(backend_path))
status_path = mozpath.join(env.topobjdir, 'config.status')
with open(backend_path, 'r') as fh:
sources = set(mozpath.relpath(source.strip(), env.topsrcdir)
for source in fh)
self.assertEquals(sources,
set(['mochitest.ini',
'mochitest-common.ini',
'moz.build',
mozpath.relpath(status_path, env.topsrcdir)]))
if __name__ == '__main__':
main()