Bug 969585 - Fix installing support files from a manfiest with just disabled tests. r=gps
authorTed Mielczarek <ted@mielczarek.org>
Thu, 13 Feb 2014 07:46:59 -0500
changeset 168466 b8c01f1a6e7408770055a84b60e4010bc0f7eb8c
parent 168465 35579f5201a394a170c7f045ce353ab674e25681
child 168467 acefe67f49db7628846a2d8cb51b43dc391c8039
push id39735
push usertmielczarek@mozilla.com
push dateThu, 13 Feb 2014 15:25:38 +0000
treeherdermozilla-inbound@cf5d9c8a1368 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs969585
milestone30.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 969585 - Fix installing support files from a manfiest with just disabled tests. r=gps
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/foo.txt
python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/moz.build
python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/support-disabled-tests.ini
python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/test_blah.html
python/mozbuild/mozbuild/test/frontend/test_emitter.py
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -497,17 +497,17 @@ class TreeMetadataEmitter(LoggingMixin):
             for test in filtered:
                 obj.tests.append(test)
 
                 obj.installs[mozpath.normpath(test['path'])] = \
                     mozpath.join(out_dir, test['relpath'])
 
                 process_support_files(test)
 
-            if not m.tests:
+            if not filtered:
                 # If there are no tests, look for support-files under DEFAULT.
                 process_support_files(defaults)
 
             # We also copy the manifest into the output directory.
             out_path = mozpath.join(out_dir, mozpath.basename(manifest_path))
             obj.installs[path] = out_path
 
             # Some manifests reference files that are auto generated as
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/foo.txt
@@ -0,0 +1,1 @@
+hello
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/moz.build
@@ -0,0 +1,4 @@
+# Any copyright is dedicated to the Public Domain.
+# http://creativecommons.org/publicdomain/zero/1.0/
+
+MOCHITEST_MANIFESTS += ['support-disabled-tests.ini']
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/support-disabled-tests.ini
@@ -0,0 +1,5 @@
+[DEFAULT]
+support-files = foo.txt
+
+[test_blah.html]
+disabled =
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/test_blah.html
@@ -0,0 +1,1 @@
+<html></html>
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -311,16 +311,27 @@ class TestEmitterBasic(unittest.TestCase
 
         objs = self.read_topsrcdir(reader)
         self.assertEqual(len(objs), 1)
         o = objs[0]
         self.assertEqual(len(o.installs), 2)
         paths = sorted([k[len(o.directory)+1:] for k in o.installs.keys()])
         self.assertEqual(paths, ["foo.txt", "just-support.ini"])
 
+    def test_test_manifest_support_files_disabled_test(self):
+        """A test manifest with just disabled tests and support-files is supported."""
+        reader = self.reader('test-manifest-support-disabled-tests')
+
+        objs = self.read_topsrcdir(reader)
+        self.assertEqual(len(objs), 1)
+        o = objs[0]
+        self.assertEqual(len(o.installs), 2)
+        paths = sorted([k[len(o.directory)+1:] for k in o.installs.keys()])
+        self.assertEqual(paths, ["foo.txt", "support-disabled-tests.ini"])
+
     def test_test_manifest_keys_extracted(self):
         """Ensure all metadata from test manifests is extracted."""
         reader = self.reader('test-manifest-keys-extracted')
 
         objs = [o for o in self.read_topsrcdir(reader)
                 if isinstance(o, TestManifest)]
 
         self.assertEqual(len(objs), 6)