Index: mojo/tools/apptest_runner.py |
diff --git a/mojo/tools/apptest_runner.py b/mojo/tools/apptest_runner.py |
index d33fbea8a19029e5d42d9937b8f84db9b9d891fe..269ff7036b9b425f4cd0c3b7b8aff9ab973ccb4c 100755 |
--- a/mojo/tools/apptest_runner.py |
+++ b/mojo/tools/apptest_runner.py |
@@ -22,6 +22,8 @@ def main(): |
help="a file listing apptests to run") |
parser.add_argument("build_dir", type=str, help="the build output directory") |
parser.add_argument("--verbose", default=False, action='store_true') |
+ parser.add_argument('--repeat_count', default=1, metavar='INT', |
+ action='store', type=int) |
parser.add_argument('--write-full-results-to', metavar='FILENAME', |
help='Path to write the JSON list of full results.') |
args = parser.parse_args() |
@@ -50,23 +52,27 @@ def main(): |
tests = [] |
passed = [] |
failed = [] |
- for test_dict in test_list: |
- test = test_dict["test"] |
- test_name = test_dict.get("name", test) |
- test_type = test_dict.get("type", "gtest") |
- test_args = test_dict.get("args", []) |
- |
- print "Running %s...%s" % (test_name, ("\n" if args.verbose else "")), |
- sys.stdout.flush() |
- |
- tests.append(test_name) |
- assert test_type in ("gtest", "gtest_isolated") |
- isolate = test_type == "gtest_isolated" |
- result = gtest.run_apptest(config, shell, test_args, test, isolate) |
- passed.extend([test_name] if result else []) |
- failed.extend([] if result else [test_name]) |
- print "[ PASSED ]" if result else "[ FAILED ]", |
- print test_name if args.verbose or not result else "" |
+ for _ in range(args.repeat_count): |
+ for test_dict in test_list: |
+ test = test_dict["test"] |
+ test_name = test_dict.get("name", test) |
+ test_type = test_dict.get("type", "gtest") |
+ test_args = test_dict.get("args", []) |
+ |
+ print "Running %s...%s" % (test_name, ("\n" if args.verbose else "")), |
+ sys.stdout.flush() |
+ |
+ tests.append(test_name) |
+ assert test_type in ("gtest", "gtest_isolated") |
+ isolate = test_type == "gtest_isolated" |
+ result = gtest.run_apptest(config, shell, test_args, test, isolate) |
+ passed.extend([test_name] if result else []) |
+ failed.extend([] if result else [test_name]) |
+ print "[ PASSED ]" if result else "[ FAILED ]", |
+ print test_name if args.verbose or not result else "" |
+ |
+ if failed: |
+ break; |
print "[ PASSED ] %d apptests" % len(passed), |
print ": %s" % ", ".join(passed) if passed else "" |