Commit 68444af3 authored by Jeff Carpenter's avatar Jeff Carpenter Committed by Commit Bot

Add support for --gtest_repeat to run-webkit-tests

The context for this change is to allow FindIt, which only speaks GTest,
to run run-webkit-tests.

Bug: 650747
Change-Id: Ic4930cda309395f1a19a619a701140909f6f296c
Reviewed-on: https://chromium-review.googlesource.com/541757
Commit-Queue: Jeff Carpenter <jeffcarp@chromium.org>
Reviewed-by: default avatarQuinten Yearsley <qyearsley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481064}
parent 634be833
...@@ -369,6 +369,7 @@ def parse_args(args): ...@@ -369,6 +369,7 @@ def parse_args(args):
help='Output per-test profile information, using the specified profiler.'), help='Output per-test profile information, using the specified profiler.'),
optparse.make_option( optparse.make_option(
'--repeat-each', '--repeat-each',
'--gtest_repeat',
type='int', type='int',
default=1, default=1,
help='Number of times to run each test (e.g. AAABBBCCC)'), help='Number of times to run each test (e.g. AAABBBCCC)'),
......
...@@ -394,6 +394,16 @@ class RunTest(unittest.TestCase, StreamTestingMixin): ...@@ -394,6 +394,16 @@ class RunTest(unittest.TestCase, StreamTestingMixin):
tests_run = get_tests_run(['--repeat-each', '2', '--order', 'natural'] + tests_to_run) tests_run = get_tests_run(['--repeat-each', '2', '--order', 'natural'] + tests_to_run)
self.assertEqual(tests_run, ['passes/image.html', 'passes/image.html', 'passes/text.html', 'passes/text.html']) self.assertEqual(tests_run, ['passes/image.html', 'passes/image.html', 'passes/text.html', 'passes/text.html'])
def test_gtest_repeat(self):
tests_to_run = ['passes/image.html', 'passes/text.html']
tests_run = get_tests_run(['--gtest_repeat', '2', '--order', 'natural'] + tests_to_run)
self.assertEqual(tests_run, ['passes/image.html', 'passes/image.html', 'passes/text.html', 'passes/text.html'])
def test_gtest_repeat_overrides_repeat_each(self):
tests_to_run = ['passes/image.html', 'passes/text.html']
tests_run = get_tests_run(['--repeat-each', '4', '--gtest_repeat', '2', '--order', 'natural'] + tests_to_run)
self.assertEqual(tests_run, ['passes/image.html', 'passes/image.html', 'passes/text.html', 'passes/text.html'])
def test_ignore_flag(self): def test_ignore_flag(self):
# Note that passes/image.html is expected to be run since we specified it directly. # Note that passes/image.html is expected to be run since we specified it directly.
tests_run = get_tests_run(['-i', 'passes', 'passes/image.html']) tests_run = get_tests_run(['-i', 'passes', 'passes/image.html'])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment