Bug 1056862 - make |mach python-test| work even if run from outside the srcdir; r=gps

DONTBUILD because NPOTB
This commit is contained in:
Nathan Froyd
2014-08-21 11:03:26 -04:00
parent f7ddebe608
commit 8746cb9bdd

View File

@@ -63,7 +63,7 @@ class MachCommands(MachCommandBase):
# which produces output in the format Mozilla infrastructure expects.
return_code = 0
files = []
for test in tests:
for test in [mozpack.path.join(self.topsrcdir, t) for t in tests]:
if test.endswith('.py') and os.path.isfile(test):
files.append(test)
elif os.path.isfile(test + '.py'):
@@ -72,7 +72,8 @@ class MachCommands(MachCommandBase):
files += glob.glob(mozpack.path.join(test, 'test*.py'))
files += glob.glob(mozpack.path.join(test, 'unit*.py'))
else:
self.log(logging.WARN, 'python-test', {'test': test},
self.log(logging.WARN, 'python-test',
{'test': mozpack.path.relpath(test, self.topsrcdir)},
'TEST-UNEXPECTED-FAIL | Invalid test: {test}')
if stop:
return 1