From 0b34d934a0d57367372358ee72fb04f0867edcfa Mon Sep 17 00:00:00 2001 From: Gijs Kruitbosch Date: Thu, 1 May 2014 11:05:36 +0100 Subject: [PATCH] Bug 1004410 - allow running mochitests against an arbitrary binary, r=jmaher --HG-- extra : rebase_source : ba7e34aaffe2dd845b8717a34dc27c7f59983534 --- testing/mochitest/mach_commands.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/testing/mochitest/mach_commands.py b/testing/mochitest/mach_commands.py index 164e1b8ba61f..4ba767b56b1a 100644 --- a/testing/mochitest/mach_commands.py +++ b/testing/mochitest/mach_commands.py @@ -190,7 +190,7 @@ class MochitestRunner(MozbuildObject): jsdebugger=False, debug_on_failure=False, start_at=None, end_at=None, e10s=False, dmd=False, dump_output_directory=None, dump_about_memory_after_test=False, dump_dmd_after_test=False, - install_extension=None, quiet=False, environment=[], **kwargs): + install_extension=None, quiet=False, environment=[], app_override=None, **kwargs): """Runs a mochitest. test_paths are path to tests. They can be a relative path from the @@ -352,6 +352,11 @@ class MochitestRunner(MozbuildObject): return 1 options.debuggerArgs = debugger_args + if app_override == "dist": + options.app = self.get_binary_path(where='staged-package') + elif app_override: + options.app = app_override + options = opts.verifyOptions(options, runner) if options is None: @@ -521,6 +526,13 @@ def MochitestCommand(func): help="Sets the given variable in the application's environment") func = setenv(func) + app_override = CommandArgument('--app-override', default=None, action='store', + help="Override the default binary used to run tests with the path you provide, e.g. " \ + " --app-override /usr/bin/firefox . " \ + "If you have run ./mach package beforehand, you can specify 'dist' to " \ + "run tests against the distribution bundle's binary."); + func = app_override(func) + return func def B2GCommand(func):