From 1777880f54acce46df7d1cf207e3a70ee3d6beac Mon Sep 17 00:00:00 2001 From: "pbos@webrtc.org" Date: Wed, 7 Jan 2015 11:03:19 +0000 Subject: [PATCH] Roll gtest-parallel. Includes a method for setting additional arguments to binaries. BUG=4142 R=kjellander@webrtc.org TBR=andrew@webrtc.org Review URL: https://webrtc-codereview.appspot.com/32969004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@8009 4adac7df-926f-26a2-2b94-8c16560cd09d --- third_party/gtest-parallel/README.webrtc | 2 +- third_party/gtest-parallel/gtest-parallel | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/third_party/gtest-parallel/README.webrtc b/third_party/gtest-parallel/README.webrtc index b16e61532..658ef95b0 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: ebf302fdc83f2c5afb9b7b45dc14dd0807b9e67d +Version: e61a8975cc124c9a07cb903b76b46b3e669cd179 License: Apache 2.0 License File: LICENSE diff --git a/third_party/gtest-parallel/gtest-parallel b/third_party/gtest-parallel/gtest-parallel index 58affcb20..2830e818f 100755 --- a/third_party/gtest-parallel/gtest-parallel +++ b/third_party/gtest-parallel/gtest-parallel @@ -80,8 +80,17 @@ class RawFormat: def end(self): pass +# Remove additional arguments (anything after --). +additional_args = [] + +for i in range(len(sys.argv)): + if sys.argv[i] == '--': + additional_args = sys.argv[i+1:] + sys.argv = sys.argv[:i] + break + parser = optparse.OptionParser( - usage = 'usage: %prog [options] executable [executable ...]') + usage = 'usage: %prog [options] binary [binary ...] -- [additional args]') parser.add_option('-r', '--repeat', type='int', default=1, help='repeat tests') @@ -122,6 +131,8 @@ for test_binary in binaries: test_list = subprocess.Popen(command + ['--gtest_list_tests'], stdout=subprocess.PIPE).communicate()[0] + command += additional_args + test_group = '' for line in test_list.split('\n'): if not line.strip():