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
parent 9ed974fd3b
commit db9d818e14
2 changed files with 9 additions and 2 deletions

View File

@ -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('/', '_')

View File

@ -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)