From 54cb6b62ce3720778b95a3114736d9702e398ee5 Mon Sep 17 00:00:00 2001 From: Steven Lee Date: Mon, 4 Aug 2014 23:29:00 -0400 Subject: [PATCH] Bug 1046515 - Add support for the "repeat" and "run-until-failure" mach commands on B2G. r=ahal --- 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 8ed8d0ed149b..9fa762d92b82 100644 --- a/testing/mochitest/mach_commands.py +++ b/testing/mochitest/mach_commands.py @@ -106,7 +106,7 @@ class MochitestRunner(MozbuildObject): def run_b2g_test(self, test_paths=None, b2g_home=None, xre_path=None, total_chunks=None, this_chunk=None, no_window=None, - **kwargs): + repeat=0, run_until_failure=False, **kwargs): """Runs a b2g mochitest. test_paths is an enumerable of paths to tests. It can be a relative path @@ -152,6 +152,8 @@ class MochitestRunner(MozbuildObject): options.noWindow = no_window options.totalChunks = total_chunks options.thisChunk = this_chunk + options.repeat = repeat + options.runUntilFailure = run_until_failure options.symbolsPath = os.path.join(self.distdir, 'crashreporter-symbols') @@ -586,6 +588,16 @@ def B2GCommand(func): 'executed.') func = path(func) + repeat = CommandArgument('--repeat', type=int, default=0, + help='Repeat the test the given number of times.') + func = repeat(func) + + runUntilFailure = CommandArgument("--run-until-failure", action='store_true', + help='Run tests repeatedly and stops on the first time a test fails. ' \ + 'Default cap is 30 runs, which can be overwritten ' \ + 'with the --repeat parameter.') + func = runUntilFailure(func) + return func