Pull in new commits from the gtest-parallel upstream repo

22c71034 Add flag for running only failed and new tests
2f5c75fd Fix support for TYPED_TEST_CASEs.

Review-Url: https://codereview.webrtc.org/2025293002
Cr-Commit-Position: refs/heads/master@{#12994}
This commit is contained in:
kwiberg
2016-06-01 09:16:40 -07:00
committed by Commit bot
parent cebf0a2728
commit 7b36ac446a
2 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,5 @@
URL: https://github.com/google/gtest-parallel
Version: 92eb6adf9df6eee34bb768b40af984e68e86d7cf
Version: df918e22b6037df00e3d3d7b6d5809e2009265dd
License: Apache 2.0
License File: LICENSE

View File

@ -251,6 +251,8 @@ parser.add_option('-d', '--output_dir', type='string',
help='output directory for test logs')
parser.add_option('-r', '--repeat', type='int', default=1,
help='repeat tests')
parser.add_option('--failed', action='store_true', default=False,
help='run only failed and new tests')
parser.add_option('-w', '--workers', type='int',
default=multiprocessing.cpu_count(),
help='number of workers to spawn')
@ -305,7 +307,8 @@ for test_binary in binaries:
if not line.strip():
continue
if line[0] != " ":
test_group = line.strip()
# Remove comments for typed tests and strip whitespace.
test_group = line.split('#')[0].strip()
continue
# Remove comments for parameterized tests and strip whitespace.
line = line.split('#')[0].strip()
@ -318,6 +321,12 @@ for test_binary in binaries:
tests.append((times.get_test_time(test_binary, test),
test_binary, test, command))
if options.failed:
# The first element of each entry is the runtime of the most recent
# run if it was successful, or None if the test is new or the most
# recent run failed.
tests = [x for x in tests if x[0] is None]
# Sort tests by falling runtime (with None, which is what we get for
# new and failing tests, being considered larger than any real
# runtime).