mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Backed out changeset 2a89253c22cc (bug 939080) for Desktop B2G bustage.
This commit is contained in:
parent
fc18d05771
commit
c27c94f281
@ -176,6 +176,9 @@ Files referenced by manifests are automatically installed into the object
|
||||
directory into paths defined in
|
||||
: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
|
||||
|
@ -1023,14 +1023,12 @@ class RecursiveMakeBackend(CommonBackend):
|
||||
self.backend_input_files.add(os.path.join(obj.topsrcdir,
|
||||
obj.manifest_relpath))
|
||||
|
||||
# Don't allow files to be defined multiple times unless it is allowed.
|
||||
# We currently allow duplicates for non-test files or test files if
|
||||
# the manifest is listed as a duplicate.
|
||||
for source, (dest, is_test) in obj.installs.items():
|
||||
# Duplicate manifests may define the same file. That's OK.
|
||||
for source, dest in obj.installs.items():
|
||||
try:
|
||||
self._install_manifests['tests'].add_symlink(source, dest)
|
||||
except ValueError:
|
||||
if not obj.dupe_manifest and is_test:
|
||||
if not obj.dupe_manifest:
|
||||
raise
|
||||
|
||||
for dest in obj.external_installs:
|
||||
|
@ -357,9 +357,7 @@ class TestManifest(SandboxDerived):
|
||||
'flavor',
|
||||
|
||||
# Maps source filename to destination filename. The destination
|
||||
# path is relative from the tests root directory. Values are 2-tuples
|
||||
# of (destpath, is_test_file) where the 2nd item is True if this
|
||||
# item represents a test file (versus a support file).
|
||||
# path is relative from the tests root directory.
|
||||
'installs',
|
||||
|
||||
# Where all files for this manifest flavor are installed in the unified
|
||||
|
@ -415,7 +415,7 @@ class TreeMetadataEmitter(LoggingMixin):
|
||||
obj.tests.append(test)
|
||||
|
||||
obj.installs[mozpath.normpath(test['path'])] = \
|
||||
(mozpath.join(out_dir, test['relpath']), True)
|
||||
mozpath.join(out_dir, test['relpath'])
|
||||
|
||||
for thing, seen in extras:
|
||||
value = test.get(thing, '')
|
||||
@ -439,18 +439,21 @@ class TreeMetadataEmitter(LoggingMixin):
|
||||
|
||||
for f in paths:
|
||||
full = mozpath.normpath(mozpath.join(manifest_dir, f))
|
||||
obj.installs[full] = \
|
||||
(mozpath.join(out_dir, f), False)
|
||||
obj.installs[full] = mozpath.join(out_dir, f)
|
||||
|
||||
else:
|
||||
full = mozpath.normpath(mozpath.join(manifest_dir,
|
||||
pattern))
|
||||
obj.installs[full] = (mozpath.normpath(
|
||||
mozpath.join(out_dir, pattern)), False)
|
||||
# Only install paths in our directory. This
|
||||
# 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.
|
||||
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
|
||||
# part of the build or shouldn't be installed for some
|
||||
|
@ -98,11 +98,6 @@ CONFIGS = {
|
||||
'non_global_defines': [],
|
||||
'substs': [],
|
||||
},
|
||||
'test-manifests-duplicate-support-files': {
|
||||
'defines': [],
|
||||
'non_global_defines': [],
|
||||
'substs': [],
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,4 +0,0 @@
|
||||
[DEFAULT]
|
||||
support-files = support-file.txt
|
||||
|
||||
[test_foo.js]
|
@ -1,4 +0,0 @@
|
||||
[DEFAULT]
|
||||
support-files = support-file.txt
|
||||
|
||||
[test_bar.js]
|
@ -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',
|
||||
]
|
@ -527,6 +527,7 @@ class TestRecursiveMakeBackend(BackendTester):
|
||||
env = self._consume('final_target', RecursiveMakeBackend)
|
||||
|
||||
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[env.topobjdir] = []
|
||||
expected[os.path.join(env.topobjdir, 'both')] = [
|
||||
@ -553,15 +554,6 @@ class TestRecursiveMakeBackend(BackendTester):
|
||||
str.startswith('DIST_SUBDIR')]
|
||||
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__':
|
||||
main()
|
||||
|
@ -1,4 +0,0 @@
|
||||
[DEFAULT]
|
||||
support-files = ../support-file.txt
|
||||
|
||||
[test_foo.js]
|
@ -1,4 +0,0 @@
|
||||
# Any copyright is dedicated to the Public Domain.
|
||||
# http://creativecommons.org/publicdomain/zero/1.0/
|
||||
|
||||
MOCHITEST_MANIFESTS += ['child/mochitest.ini']
|
@ -249,34 +249,34 @@ class TestEmitterBasic(unittest.TestCase):
|
||||
'a11y.ini': {
|
||||
'flavor': 'a11y',
|
||||
'installs': {
|
||||
'a11y.ini': False,
|
||||
'test_a11y.js': True,
|
||||
'a11y.ini',
|
||||
'test_a11y.js',
|
||||
# From ** wildcard.
|
||||
'a11y-support/foo': False,
|
||||
'a11y-support/dir1/bar': False,
|
||||
'a11y-support/foo',
|
||||
'a11y-support/dir1/bar',
|
||||
},
|
||||
},
|
||||
'browser.ini': {
|
||||
'flavor': 'browser-chrome',
|
||||
'installs': {
|
||||
'browser.ini': False,
|
||||
'test_browser.js': True,
|
||||
'support1': False,
|
||||
'support2': False,
|
||||
'browser.ini',
|
||||
'test_browser.js',
|
||||
'support1',
|
||||
'support2',
|
||||
},
|
||||
},
|
||||
'metro.ini': {
|
||||
'flavor': 'metro-chrome',
|
||||
'installs': {
|
||||
'metro.ini': False,
|
||||
'test_metro.js': True,
|
||||
'metro.ini',
|
||||
'test_metro.js',
|
||||
},
|
||||
},
|
||||
'mochitest.ini': {
|
||||
'flavor': 'mochitest',
|
||||
'installs': {
|
||||
'mochitest.ini': False,
|
||||
'test_mochitest.js': True,
|
||||
'mochitest.ini',
|
||||
'test_mochitest.js',
|
||||
},
|
||||
'external': {
|
||||
'external1',
|
||||
@ -286,20 +286,20 @@ class TestEmitterBasic(unittest.TestCase):
|
||||
'chrome.ini': {
|
||||
'flavor': 'chrome',
|
||||
'installs': {
|
||||
'chrome.ini': False,
|
||||
'test_chrome.js': True,
|
||||
'chrome.ini',
|
||||
'test_chrome.js',
|
||||
},
|
||||
},
|
||||
'xpcshell.ini': {
|
||||
'flavor': 'xpcshell',
|
||||
'dupe': True,
|
||||
'installs': {
|
||||
'xpcshell.ini': False,
|
||||
'test_xpcshell.js': True,
|
||||
'head1': False,
|
||||
'head2': False,
|
||||
'tail1': False,
|
||||
'tail2': False,
|
||||
'xpcshell.ini',
|
||||
'test_xpcshell.js',
|
||||
'head1',
|
||||
'head2',
|
||||
'tail1',
|
||||
'tail2',
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -318,10 +318,9 @@ class TestEmitterBasic(unittest.TestCase):
|
||||
self.assertEqual(len(o.installs), len(m['installs']))
|
||||
for path in o.installs.keys():
|
||||
self.assertTrue(path.startswith(o.directory))
|
||||
relpath = path[len(o.directory)+1:]
|
||||
path = path[len(o.directory)+1:]
|
||||
|
||||
self.assertIn(relpath, m['installs'])
|
||||
self.assertEqual(o.installs[path][1], m['installs'][relpath])
|
||||
self.assertIn(path, m['installs'])
|
||||
|
||||
def test_test_manifest_unmatched_generated(self):
|
||||
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())
|
||||
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):
|
||||
reader = self.reader('ipdl_sources')
|
||||
objs = self.read_topsrcdir(reader)
|
||||
|
@ -2,6 +2,11 @@
|
||||
# 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/.
|
||||
|
||||
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
|
||||
# textboxes and lists only, so skip this test on Mac
|
||||
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
|
Loading…
Reference in New Issue
Block a user