Bug 1140161 - Sensibly handle patterns with absolute paths in TEST_HARNESS_FILES. r=gps

This commit is contained in:
Brian O'Keefe 2015-03-05 09:22:43 -05:00
Родитель d6d7d5c6d6
Коммит b27fb40678
2 изменённых файлов: 9 добавлений и 2 удалений

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

@ -810,7 +810,7 @@ class RecursiveMakeBackend(CommonBackend):
for path, patterns in obj.srcdir_pattern_files.iteritems():
for p in patterns:
self._install_manifests['tests'].add_pattern_symlink(obj.srcdir, p, path)
self._install_manifests['tests'].add_pattern_symlink(p[0], p[1], path)
for path, files in obj.objdir_files.iteritems():
prefix = 'TEST_HARNESS_%s' % path.replace('/', '_')

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

@ -583,7 +583,14 @@ class TreeMetadataEmitter(LoggingMixin):
else:
resolved = context.resolve_path(s)
if '*' in s:
srcdir_pattern_files[path].append(s);
if s[0] == '/':
pattern_start = resolved.index('*')
base_path = mozpath.dirname(resolved[:pattern_start])
pattern = resolved[len(base_path)+1:]
else:
base_path = context.srcdir
pattern = s
srcdir_pattern_files[path].append((base_path, pattern));
elif not os.path.exists(resolved):
raise SandboxValidationError(
'File listed in TEST_HARNESS_FILES does not exist: %s' % s, context)