Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: third_party/gtest-parallel/gtest-parallel-wrapper.py

Issue 2513073002: Update gtest-parallel and introduce gtest-parallel-wrapper. (Closed)
Patch Set: Updated README.webrtc. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/gtest-parallel/gtest-parallel ('k') | tools/mb/mb.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
+# 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()))
« no previous file with comments | « third_party/gtest-parallel/gtest-parallel ('k') | tools/mb/mb.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698