From 7b36ac446a7b7781bab406d448b47dbe5ac72730 Mon Sep 17 00:00:00 2001 From: kwiberg Date: Wed, 1 Jun 2016 09:16:40 -0700 Subject: [PATCH] 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} --- third_party/gtest-parallel/README.webrtc | 2 +- third_party/gtest-parallel/gtest-parallel | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/third_party/gtest-parallel/README.webrtc b/third_party/gtest-parallel/README.webrtc index 7e7fdda48f..300fc5d5c4 100644 --- a/third_party/gtest-parallel/README.webrtc +++ b/third_party/gtest-parallel/README.webrtc @@ -1,5 +1,5 @@ URL: https://github.com/google/gtest-parallel -Version: 92eb6adf9df6eee34bb768b40af984e68e86d7cf +Version: df918e22b6037df00e3d3d7b6d5809e2009265dd License: Apache 2.0 License File: LICENSE diff --git a/third_party/gtest-parallel/gtest-parallel b/third_party/gtest-parallel/gtest-parallel index 3e2fdb4ba8..9b1f9eee35 100755 --- a/third_party/gtest-parallel/gtest-parallel +++ b/third_party/gtest-parallel/gtest-parallel @@ -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).