Chromium Code Reviews| Index: third_party/gtest-parallel/gtest-parallel-wrapper.py |
| diff --git a/third_party/gtest-parallel/gtest-parallel-wrapper.py b/third_party/gtest-parallel/gtest-parallel-wrapper.py |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..1d8bcac71323fcf2572861cc5e24e5d8b9709d3d |
| --- /dev/null |
| +++ b/third_party/gtest-parallel/gtest-parallel-wrapper.py |
| @@ -0,0 +1,37 @@ |
| +#!/usr/bin/env python |
| + |
| +# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| +# |
| +# Use of this source code is governed by a BSD-style license |
| +# that can be found in the LICENSE file in the root of the source |
| +# tree. An additional intellectual property rights grant can be found |
| +# in the file PATENTS. All contributing project authors may |
| +# be found in the AUTHORS file in the root of the source tree. |
| + |
| +import os |
| +import subprocess |
| +import sys |
| + |
| +# GTEST_SHARD_INDEX and GTEST_TOTAL_SHARDS must be removed from the environment |
|
kjellander_webrtc
2016/11/21 07:14:31
Ah, I didn't know having these set caused bugs. Th
|
| +# otherwise it will be picked up by the binary, causing a bug where only tests |
| +# in the firsh shard are executed. |
| +test_env = os.environ.copy() |
| +gtest_shard_index = test_env.pop('GTEST_SHARD_INDEX', '0') |
| +gtest_total_shards = test_env.pop('GTEST_TOTAL_SHARDS', '1') |
| + |
| +gtest_parallel_path = os.path.dirname(os.path.abspath(__file__)) |
| +gtest_parallel_path = os.path.join(gtest_parallel_path, 'gtest-parallel') |
| + |
| +command = [ |
| + sys.executable, |
| + gtest_parallel_path, |
| + '--shard_count', |
| + gtest_total_shards, |
| + '--shard_index', |
| + gtest_shard_index, |
| +] + sys.argv[1:] |
| + |
| +print 'gtest-parallel-wrapper: Executing command %s' % ' '.join(command) |
| +sys.stdout.flush() |
| + |
| +sys.exit(subprocess.call(command, env=test_env, cwd=os.getcwd())) |
|
kjellander_webrtc
2016/11/21 07:14:31
What if one runs this script and presses ctrl+c to
ehmaldonado_webrtc
2016/11/21 13:23:57
It seems like I can abort it just fine. Maybe you
|