Bug 932186 - Allow mach to specify a manifest file as a test path. r=ted

This commit is contained in:
Mark Hammond 2013-11-25 10:33:11 +11:00
parent 386e32e390
commit 185642e733
2 changed files with 13 additions and 2 deletions

View File

@ -314,7 +314,15 @@ class MochitestRunner(MozbuildObject):
print('You may need to run |mach build| to build the test files.') print('You may need to run |mach build| to build the test files.')
return 1 return 1
options.testPath = test_path # Handle test_path pointing at a manifest file so conditions in
# the manifest are processed. This is a temporary solution
# pending bug 938019.
# The manifest basename is the same as |suite|, except for plain
manifest_base = 'mochitest' if suite == 'plain' else suite
if os.path.basename(test_root_file) == manifest_base + '.ini':
options.manifestFile = test_root_file
else:
options.testPath = test_path
if rerun_failures: if rerun_failures:
options.testManifest = failure_file_path options.testManifest = failure_file_path

View File

@ -360,9 +360,12 @@ class MochitestUtilsMixin(object):
manifest.read(options.manifestFile) manifest.read(options.manifestFile)
# Bug 883858 - return all tests including disabled tests # Bug 883858 - return all tests including disabled tests
tests = manifest.active_tests(disabled=True, **mozinfo.info) tests = manifest.active_tests(disabled=True, **mozinfo.info)
# We need to ensure we match on a complete directory name matching the
# test root, and not a substring somewhere else in the path.
test_root = os.path.sep + self.getTestRoot(options) + os.path.sep
paths = [] paths = []
for test in tests: for test in tests:
tp = test['path'].split(self.getTestRoot(options), 1)[1].strip('/') tp = test['path'].split(test_root, 1)[1].replace('\\', '/').strip('/')
# Filter out tests if we are using --test-path # Filter out tests if we are using --test-path
if options.testPath and not tp.startswith(options.testPath): if options.testPath and not tp.startswith(options.testPath):