Skip to content

Commit

Permalink
Bug 1056862 - make |mach python-test| work even if run from outside t…
Browse files Browse the repository at this point in the history
…he srcdir; r=gps

DONTBUILD because NPOTB
  • Loading branch information
froydnj committed Aug 21, 2014
1 parent 6e8227f commit 77b3f52
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def python_test(self, tests, verbose=False, stop=False):
# 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'):
Expand All @@ -72,7 +72,8 @@ def python_test(self, tests, verbose=False, stop=False):
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
Expand Down

0 comments on commit 77b3f52

Please sign in to comment.