Bug 979640 - Make build system error on missing test files; r=ted

Previously, the build system may silently missing test files defined in
manifests. This patch makes missing test files a fatal error, detected
when reading test manifests.

The test_bug872273.html XBL test appeared to be orphaned in
content/xbl/test. It has been reunited with its family.

dom/tests/mochitest/notification referenced a single test file which was
recently deleted. That manifest has been removed.

Missing test files related to the Python unit tests for the build system
have been added. (They are a bunch of empty files.)
This commit is contained in:
Gregory Szorc
2014-03-04 17:48:50 -08:00
parent 7f16a49915
commit f2c36e003c
16 changed files with 75 additions and 60 deletions

View File

@@ -476,7 +476,16 @@ class TreeMetadataEmitter(LoggingMixin):
filtered = m.tests
if filter_inactive:
filtered = m.active_tests(disabled=False, **self.mozinfo)
# We return tests that don't exist because we want manifests
# defining tests that don't exist to result in error.
filtered = m.active_tests(exists=False, disabled=False,
**self.mozinfo)
missing = [t['name'] for t in filtered if not os.path.exists(t['path'])]
if missing:
raise SandboxValidationError('Test manifest (%s) lists '
'test that does not exist: %s' % (
path, ', '.join(missing)))
out_dir = mozpath.join(install_prefix, manifest_reldir)

View File

@@ -0,0 +1 @@
[test_missing.html]

View File

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

View File

@@ -476,6 +476,14 @@ class TestEmitterBasic(unittest.TestCase):
self.assertEqual(o.installs[expected],
('testing/mochitest/tests/child/support-file.txt', False))
def test_test_manifest_missing_test_error(self):
"""Missing test files should result in error."""
reader = self.reader('test-manifest-missing-test-file')
with self.assertRaisesRegexp(SandboxValidationError,
'lists test that does not exist: test_missing.html'):
self.read_topsrcdir(reader)
def test_ipdl_sources(self):
reader = self.reader('ipdl_sources')
objs = self.read_topsrcdir(reader)