Bug 1446019 - Improve error message for LOCAL_INCLUDES pointing to topobjdir; r=froydnj

The old message is ambiguous as to why it failed. The new one tells
you why and hopefully gives you enough info to fix it.

MozReview-Commit-ID: 9cBpYLpCFmt

--HG--
extra : rebase_source : cf0899e8c5f5330d31c645cba27d1bd3fb19e814
This commit is contained in:
Gregory Szorc 2018-03-15 09:43:35 -07:00
Родитель 13c27bdca7
Коммит b78a4e45de
2 изменённых файлов: 6 добавлений и 4 удалений

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

@ -1135,8 +1135,8 @@ class TreeMetadataEmitter(LoggingMixin):
if (full_path == context.config.topsrcdir or
full_path == context.config.topobjdir):
raise SandboxValidationError('Path specified in LOCAL_INCLUDES '
'is not allowed: %s (resolved to %s)' % (local_include,
full_path), context)
'(%s) resolves to the topsrcdir or topobjdir (%s), which is '
'not allowed' % (local_include, full_path), context)
include_obj = LocalInclude(context, local_include)
local_includes.append(include_obj.path.full_path)
yield include_obj

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

@ -1041,14 +1041,16 @@ class TestEmitterBasic(unittest.TestCase):
with self.assertRaisesRegexp(
SandboxValidationError,
'Path specified in LOCAL_INCLUDES is not allowed:'):
'Path specified in LOCAL_INCLUDES.*resolves to the '
'topsrcdir or topobjdir'):
objs = self.read_topsrcdir(reader)
reader = self.reader('local_includes-invalid/objdir')
with self.assertRaisesRegexp(
SandboxValidationError,
'Path specified in LOCAL_INCLUDES is not allowed:'):
'Path specified in LOCAL_INCLUDES.*resolves to the '
'topsrcdir or topobjdir'):
objs = self.read_topsrcdir(reader)
def test_generated_includes(self):