Bug 797471 - Handle mochitest failures gracefully in mach; r=Ms2ger

This commit is contained in:
Gregory Szorc 2012-11-14 12:56:02 -08:00
parent 24256e418b
commit 9eac13abf3
2 changed files with 8 additions and 7 deletions

View File

@ -62,7 +62,7 @@ class ProcessExecutionMixin(LoggingMixin):
ignore_children is proxied to mozprocess's ignore_children.
ensure_exit_code is used to ensure the exit code of a process matches
what is expected. If it is an integer, we raise an Exception is the
what is expected. If it is an integer, we raise an Exception if the
exit code does not match this value. If it is True, we ensure the exit
code is 0. If it is False, we don't perform any exit code validation.
"""

View File

@ -82,7 +82,8 @@ class MochitestRunner(MozbuildObject):
else:
env = {}
self._run_make(directory='.', target=target, append_env=env)
return self._run_make(directory='.', target=target, append_env=env,
ensure_exit_code=False)
@CommandProvider
@ -91,28 +92,28 @@ class MachCommands(MachCommandBase):
@CommandArgument('test_file', default=None, nargs='?', metavar='TEST',
help=generic_help)
def run_mochitest_plain(self, test_file):
self.run_mochitest(test_file, 'plain')
return self.run_mochitest(test_file, 'plain')
@Command('mochitest-chrome', help='Run a chrome mochitest.')
@CommandArgument('test_file', default=None, nargs='?', metavar='TEST',
help=generic_help)
def run_mochitest_chrome(self, test_file):
self.run_mochitest(test_file, 'chrome')
return self.run_mochitest(test_file, 'chrome')
@Command('mochitest-browser', help='Run a mochitest with browser chrome.')
@CommandArgument('test_file', default=None, nargs='?', metavar='TEST',
help=generic_help)
def run_mochitest_browser(self, test_file):
self.run_mochitest(test_file, 'browser')
return self.run_mochitest(test_file, 'browser')
@Command('mochitest-a11y', help='Run an a11y mochitest.')
@CommandArgument('test_file', default=None, nargs='?', metavar='TEST',
help=generic_help)
def run_mochitest_a11y(self, test_file):
self.run_mochitest(test_file, 'a11y')
return self.run_mochitest(test_file, 'a11y')
def run_mochitest(self, test_file, flavor):
self._ensure_state_subdir_exists('.')
mochitest = self._spawn(MochitestRunner)
mochitest.run_mochitest_test(test_file, flavor)
return mochitest.run_mochitest_test(test_file, flavor)