Bug 1341502: Fix automatic regeneration of backend when an included test manifest changes. r=mshal
☠☠ backed out by 47fd19d08a83 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Tue, 21 Feb 2017 17:31:21 -0800
changeset 393495 e4e02bf4f094e464bd55404ce78e1e0aa5b7b2ab
parent 393494 16ebf28d9b49647b80d6b561745cba24e97b8b74
child 393496 22b0c9160df833f19740857f7e7d73439d235f26
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1341502
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1341502: Fix automatic regeneration of backend when an included test manifest changes. r=mshal MozReview-Commit-ID: 1ZQNQpqboz9
python/mozbuild/mozbuild/backend/test_manifest.py
python/mozbuild/mozbuild/test/backend/data/test-manifests-backend-sources/mochitest-common.ini
python/mozbuild/mozbuild/test/backend/data/test-manifests-backend-sources/mochitest.ini
python/mozbuild/mozbuild/test/backend/data/test-manifests-backend-sources/moz.build
python/mozbuild/mozbuild/test/backend/data/test-manifests-backend-sources/test_bar.js
python/mozbuild/mozbuild/test/backend/data/test-manifests-backend-sources/test_foo.js
python/mozbuild/mozbuild/test/backend/test_test_manifest.py
--- a/python/mozbuild/mozbuild/backend/test_manifest.py
+++ b/python/mozbuild/mozbuild/backend/test_manifest.py
@@ -27,16 +27,19 @@ class TestManifestBackend(PartialBackend
             self.environment.topobjdir, 'config.status'))
 
     def consume_object(self, obj):
         if not isinstance(obj, TestManifest):
             return
 
         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
 
             if isinstance(obj.manifest, ReftestManifest):
                 # Mark included files as part of the build backend so changes
                 # result in re-config.
                 self.backend_input_files |= obj.manifest.manifests
         except ImportError:
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/backend/data/test-manifests-backend-sources/mochitest-common.ini
@@ -0,0 +1,1 @@
+[test_bar.js]
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/backend/data/test-manifests-backend-sources/mochitest.ini
@@ -0,0 +1,2 @@
+[test_foo.js]
+[include:mochitest-common.ini]
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/backend/data/test-manifests-backend-sources/moz.build
@@ -0,0 +1,6 @@
+# Any copyright is dedicated to the Public Domain.
+# http://creativecommons.org/publicdomain/zero/1.0/
+
+MOCHITEST_MANIFESTS += [
+    'mochitest.ini',
+]
new file mode 100644
new file mode 100644
--- a/python/mozbuild/mozbuild/test/backend/test_test_manifest.py
+++ b/python/mozbuild/mozbuild/test/backend/test_test_manifest.py
@@ -63,11 +63,30 @@ class TestTestManifestBackend(BackendTes
                           set(['dir1/xpcshell.ini',
                                'xpcshell.ini',
                                'mochitest.ini']))
 
         manifest_path = mozpath.join(env.topsrcdir, 'xpcshell.ini')
         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()