Backed out changeset 2a89253c22cc (bug 939080) for Desktop B2G bustage.

This commit is contained in:
Ryan VanderMeulen 2013-11-21 14:15:27 -05:00
parent fc18d05771
commit c27c94f281
16 changed files with 44 additions and 90 deletions

View File

@ -176,6 +176,9 @@ Files referenced by manifests are automatically installed into the object
directory into paths defined in directory into paths defined in
:py:func:`mozbuild.frontend.emitter.TreeMetadataEmitter._process_test_manifest`. :py:func:`mozbuild.frontend.emitter.TreeMetadataEmitter._process_test_manifest`.
Referenced files in the manifest not in the same directory tree as the manifest
file are **not** installed.
.. _reftest_manifests: .. _reftest_manifests:
Reftest Manifests Reftest Manifests

View File

@ -1023,14 +1023,12 @@ class RecursiveMakeBackend(CommonBackend):
self.backend_input_files.add(os.path.join(obj.topsrcdir, self.backend_input_files.add(os.path.join(obj.topsrcdir,
obj.manifest_relpath)) obj.manifest_relpath))
# Don't allow files to be defined multiple times unless it is allowed. # Duplicate manifests may define the same file. That's OK.
# We currently allow duplicates for non-test files or test files if for source, dest in obj.installs.items():
# the manifest is listed as a duplicate.
for source, (dest, is_test) in obj.installs.items():
try: try:
self._install_manifests['tests'].add_symlink(source, dest) self._install_manifests['tests'].add_symlink(source, dest)
except ValueError: except ValueError:
if not obj.dupe_manifest and is_test: if not obj.dupe_manifest:
raise raise
for dest in obj.external_installs: for dest in obj.external_installs:

View File

@ -357,9 +357,7 @@ class TestManifest(SandboxDerived):
'flavor', 'flavor',
# Maps source filename to destination filename. The destination # Maps source filename to destination filename. The destination
# path is relative from the tests root directory. Values are 2-tuples # path is relative from the tests root directory.
# of (destpath, is_test_file) where the 2nd item is True if this
# item represents a test file (versus a support file).
'installs', 'installs',
# Where all files for this manifest flavor are installed in the unified # Where all files for this manifest flavor are installed in the unified

View File

@ -415,7 +415,7 @@ class TreeMetadataEmitter(LoggingMixin):
obj.tests.append(test) obj.tests.append(test)
obj.installs[mozpath.normpath(test['path'])] = \ obj.installs[mozpath.normpath(test['path'])] = \
(mozpath.join(out_dir, test['relpath']), True) mozpath.join(out_dir, test['relpath'])
for thing, seen in extras: for thing, seen in extras:
value = test.get(thing, '') value = test.get(thing, '')
@ -439,18 +439,21 @@ class TreeMetadataEmitter(LoggingMixin):
for f in paths: for f in paths:
full = mozpath.normpath(mozpath.join(manifest_dir, f)) full = mozpath.normpath(mozpath.join(manifest_dir, f))
obj.installs[full] = \ obj.installs[full] = mozpath.join(out_dir, f)
(mozpath.join(out_dir, f), False)
else: else:
full = mozpath.normpath(mozpath.join(manifest_dir, full = mozpath.normpath(mozpath.join(manifest_dir,
pattern)) pattern))
obj.installs[full] = (mozpath.normpath( # Only install paths in our directory. This
mozpath.join(out_dir, pattern)), False) # rule is somewhat arbitrary and could be lifted.
if not full.startswith(manifest_dir):
continue
obj.installs[full] = mozpath.join(out_dir, pattern)
# We also copy the manifest into the output directory. # We also copy the manifest into the output directory.
out_path = mozpath.join(out_dir, os.path.basename(manifest_path)) out_path = mozpath.join(out_dir, os.path.basename(manifest_path))
obj.installs[path] = (out_path, False) obj.installs[path] = out_path
# Some manifests reference files that are auto generated as # Some manifests reference files that are auto generated as
# part of the build or shouldn't be installed for some # part of the build or shouldn't be installed for some

View File

@ -98,11 +98,6 @@ CONFIGS = {
'non_global_defines': [], 'non_global_defines': [],
'substs': [], 'substs': [],
}, },
'test-manifests-duplicate-support-files': {
'defines': [],
'non_global_defines': [],
'substs': [],
},
} }

View File

@ -1,4 +0,0 @@
[DEFAULT]
support-files = support-file.txt
[test_foo.js]

View File

@ -1,4 +0,0 @@
[DEFAULT]
support-files = support-file.txt
[test_bar.js]

View File

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

View File

@ -527,6 +527,7 @@ class TestRecursiveMakeBackend(BackendTester):
env = self._consume('final_target', RecursiveMakeBackend) env = self._consume('final_target', RecursiveMakeBackend)
final_target_rule = "FINAL_TARGET = $(if $(XPI_NAME),$(DIST)/xpi-stage/$(XPI_NAME),$(DIST)/bin)$(DIST_SUBDIR:%=/%)" final_target_rule = "FINAL_TARGET = $(if $(XPI_NAME),$(DIST)/xpi-stage/$(XPI_NAME),$(DIST)/bin)$(DIST_SUBDIR:%=/%)"
print([x for x in os.walk(env.topobjdir)])
expected = dict() expected = dict()
expected[env.topobjdir] = [] expected[env.topobjdir] = []
expected[os.path.join(env.topobjdir, 'both')] = [ expected[os.path.join(env.topobjdir, 'both')] = [
@ -553,15 +554,6 @@ class TestRecursiveMakeBackend(BackendTester):
str.startswith('DIST_SUBDIR')] str.startswith('DIST_SUBDIR')]
self.assertEqual(found, expected_rules) self.assertEqual(found, expected_rules)
def test_test_manifests_duplicate_support_files(self):
"""Ensure duplicate support-files in test manifests work."""
env = self._consume('test-manifests-duplicate-support-files',
RecursiveMakeBackend)
p = os.path.join(env.topobjdir, '_build_manifests', 'install', 'tests')
m = InstallManifest(p)
self.assertIn('testing/mochitest/tests/support-file.txt', m)
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@ -1,4 +0,0 @@
[DEFAULT]
support-files = ../support-file.txt
[test_foo.js]

View File

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

View File

@ -249,34 +249,34 @@ class TestEmitterBasic(unittest.TestCase):
'a11y.ini': { 'a11y.ini': {
'flavor': 'a11y', 'flavor': 'a11y',
'installs': { 'installs': {
'a11y.ini': False, 'a11y.ini',
'test_a11y.js': True, 'test_a11y.js',
# From ** wildcard. # From ** wildcard.
'a11y-support/foo': False, 'a11y-support/foo',
'a11y-support/dir1/bar': False, 'a11y-support/dir1/bar',
}, },
}, },
'browser.ini': { 'browser.ini': {
'flavor': 'browser-chrome', 'flavor': 'browser-chrome',
'installs': { 'installs': {
'browser.ini': False, 'browser.ini',
'test_browser.js': True, 'test_browser.js',
'support1': False, 'support1',
'support2': False, 'support2',
}, },
}, },
'metro.ini': { 'metro.ini': {
'flavor': 'metro-chrome', 'flavor': 'metro-chrome',
'installs': { 'installs': {
'metro.ini': False, 'metro.ini',
'test_metro.js': True, 'test_metro.js',
}, },
}, },
'mochitest.ini': { 'mochitest.ini': {
'flavor': 'mochitest', 'flavor': 'mochitest',
'installs': { 'installs': {
'mochitest.ini': False, 'mochitest.ini',
'test_mochitest.js': True, 'test_mochitest.js',
}, },
'external': { 'external': {
'external1', 'external1',
@ -286,20 +286,20 @@ class TestEmitterBasic(unittest.TestCase):
'chrome.ini': { 'chrome.ini': {
'flavor': 'chrome', 'flavor': 'chrome',
'installs': { 'installs': {
'chrome.ini': False, 'chrome.ini',
'test_chrome.js': True, 'test_chrome.js',
}, },
}, },
'xpcshell.ini': { 'xpcshell.ini': {
'flavor': 'xpcshell', 'flavor': 'xpcshell',
'dupe': True, 'dupe': True,
'installs': { 'installs': {
'xpcshell.ini': False, 'xpcshell.ini',
'test_xpcshell.js': True, 'test_xpcshell.js',
'head1': False, 'head1',
'head2': False, 'head2',
'tail1': False, 'tail1',
'tail2': False, 'tail2',
}, },
}, },
} }
@ -318,10 +318,9 @@ class TestEmitterBasic(unittest.TestCase):
self.assertEqual(len(o.installs), len(m['installs'])) self.assertEqual(len(o.installs), len(m['installs']))
for path in o.installs.keys(): for path in o.installs.keys():
self.assertTrue(path.startswith(o.directory)) self.assertTrue(path.startswith(o.directory))
relpath = path[len(o.directory)+1:] path = path[len(o.directory)+1:]
self.assertIn(relpath, m['installs']) self.assertIn(path, m['installs'])
self.assertEqual(o.installs[path][1], m['installs'][relpath])
def test_test_manifest_unmatched_generated(self): def test_test_manifest_unmatched_generated(self):
reader = self.reader('test-manifest-unmatched-generated') reader = self.reader('test-manifest-unmatched-generated')
@ -347,22 +346,6 @@ class TestEmitterBasic(unittest.TestCase):
basenames = set(os.path.basename(k) for k in o.installs.keys()) basenames = set(os.path.basename(k) for k in o.installs.keys())
self.assertEqual(basenames, {'mochitest.ini', 'test_active.html'}) self.assertEqual(basenames, {'mochitest.ini', 'test_active.html'})
def test_test_manifest_parent_support_files_dir(self):
"""support-files referencing a file in a parent directory works."""
reader = self.reader('test-manifest-parent-support-files-dir')
objs = [o for o in self.read_topsrcdir(reader)
if isinstance(o, TestManifest)]
self.assertEqual(len(objs), 1)
o = objs[0]
expected = os.path.join(o.srcdir, 'support-file.txt')
self.assertIn(expected, o.installs)
self.assertEqual(o.installs[expected],
('testing/mochitest/tests/support-file.txt', False))
def test_ipdl_sources(self): def test_ipdl_sources(self):
reader = self.reader('ipdl_sources') reader = self.reader('ipdl_sources')
objs = self.read_topsrcdir(reader) objs = self.read_topsrcdir(reader)

View File

@ -2,6 +2,11 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
MOCHITEST_CHROME_FILES := \
../widgets/popup_shared.js \
../widgets/tree_shared.js \
$(SHULL)
# test_panel_focus.xul won't work if the Full Keyboard Access preference is set to # test_panel_focus.xul won't work if the Full Keyboard Access preference is set to
# textboxes and lists only, so skip this test on Mac # textboxes and lists only, so skip this test on Mac
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT)) ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))