Bug 1476973 - part 2 - assert that XPIDL_SOURCES files all exist; r=gps

We should have been checking for this from the beginning.
This commit is contained in:
Nathan Froyd 2018-07-24 15:41:47 -04:00
Родитель d886ac50bc
Коммит 61a384e83c
5 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -1385,6 +1385,10 @@ class TreeMetadataEmitter(LoggingMixin):
'{path}: DIST_INSTALL = False has no effect on XPIDL_SOURCES.')
for idl in context['XPIDL_SOURCES']:
if not os.path.exists(idl.full_path):
raise SandboxValidationError('File %s from XPIDL_SOURCES '
'does not exist' % idl.full_path, context)
yield XPIDLFile(context, idl, xpidl_module)
def _process_generated_files(self, context):

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,6 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
XPIDL_MODULE = 'my_module'
XPIDL_SOURCES = ['nonexistant.idl']

Просмотреть файл

@ -1127,6 +1127,13 @@ class TestEmitterBasic(unittest.TestCase):
reader = self.reader('xpidl-module-no-sources')
self.read_topsrcdir(reader)
def test_xpidl_module_no_sources(self):
"""Missing XPIDL_SOURCES should be rejected."""
with self.assertRaisesRegexp(SandboxValidationError, 'File .* '
'from XPIDL_SOURCES does not exist'):
reader = self.reader('missing-xpidl')
self.read_topsrcdir(reader)
def test_missing_local_includes(self):
"""LOCAL_INCLUDES containing non-existent directories should be rejected."""
with self.assertRaisesRegexp(SandboxValidationError, 'Path specified in '