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

Side by Side Diff: trunk/src/base/test/launcher/test_launcher.cc

Issue 66043005: Revert 233725 "GTTF: Make test launcher unset GTEST_ env variabl..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/test/launcher/test_launcher.h" 5 #include "base/test/launcher/test_launcher.h"
6 6
7 #if defined(OS_POSIX) 7 #if defined(OS_POSIX)
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #endif 9 #endif
10 10
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 if (shard_index_ < 0 || 609 if (shard_index_ < 0 ||
610 total_shards_ < 0 || 610 total_shards_ < 0 ||
611 shard_index_ >= total_shards_) { 611 shard_index_ >= total_shards_) {
612 LOG(ERROR) << "Invalid sharding settings: we require 0 <= " 612 LOG(ERROR) << "Invalid sharding settings: we require 0 <= "
613 << kTestShardIndex << " < " << kTestTotalShards 613 << kTestShardIndex << " < " << kTestTotalShards
614 << ", but you have " << kTestShardIndex << "=" << shard_index_ 614 << ", but you have " << kTestShardIndex << "=" << shard_index_
615 << ", " << kTestTotalShards << "=" << total_shards_ << ".\n"; 615 << ", " << kTestTotalShards << "=" << total_shards_ << ".\n";
616 return false; 616 return false;
617 } 617 }
618 618
619 // Make sure we don't pass any sharding-related environment to the child
620 // processes. This test launcher implements the sharding completely.
621 scoped_ptr<Environment> env(Environment::Create());
622 CHECK(env->UnSetVar("GTEST_TOTAL_SHARDS"));
623 CHECK(env->UnSetVar("GTEST_SHARD_INDEX"));
624
625 if (command_line->HasSwitch(kGTestRepeatFlag) && 619 if (command_line->HasSwitch(kGTestRepeatFlag) &&
626 !StringToInt(command_line->GetSwitchValueASCII(kGTestRepeatFlag), 620 !StringToInt(command_line->GetSwitchValueASCII(kGTestRepeatFlag),
627 &cycles_)) { 621 &cycles_)) {
628 LOG(ERROR) << "Invalid value for " << kGTestRepeatFlag; 622 LOG(ERROR) << "Invalid value for " << kGTestRepeatFlag;
629 return false; 623 return false;
630 } 624 }
631 625
632 // Split --gtest_filter at '-', if there is one, to separate into 626 // Split --gtest_filter at '-', if there is one, to separate into
633 // positive filter and negative filter portions. 627 // positive filter and negative filter portions.
634 std::string filter = command_line->GetSwitchValueASCII(kGTestFilterFlag); 628 std::string filter = command_line->GetSwitchValueASCII(kGTestFilterFlag);
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 921
928 g_live_processes.Get().erase(process_handle); 922 g_live_processes.Get().erase(process_handle);
929 } 923 }
930 924
931 base::CloseProcessHandle(process_handle); 925 base::CloseProcessHandle(process_handle);
932 926
933 return exit_code; 927 return exit_code;
934 } 928 }
935 929
936 } // namespace base 930 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698