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

Side by Side Diff: base/test/test_launcher.cc

Issue 23132002: GTTF: Add a basic new unit test launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed gyp cycle Created 7 years, 4 months 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
« no previous file with comments | « base/test/test_launcher.h ('k') | base/test/unit_test_launcher.h » ('j') | 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/test_launcher.h" 5 #include "base/test/test_launcher.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/environment.h" 10 #include "base/environment.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 TestLauncherDelegate::~TestLauncherDelegate() { 351 TestLauncherDelegate::~TestLauncherDelegate() {
352 } 352 }
353 353
354 int LaunchChildGTestProcess(const CommandLine& command_line, 354 int LaunchChildGTestProcess(const CommandLine& command_line,
355 const std::string& wrapper, 355 const std::string& wrapper,
356 base::TimeDelta timeout, 356 base::TimeDelta timeout,
357 bool* was_timeout) { 357 bool* was_timeout) {
358 CommandLine new_command_line(command_line.GetProgram()); 358 CommandLine new_command_line(command_line.GetProgram());
359 CommandLine::SwitchMap switches = command_line.GetSwitches(); 359 CommandLine::SwitchMap switches = command_line.GetSwitches();
360 360
361 // Strip out gtest_output flag because otherwise we would overwrite results
362 // of the other tests.
363 switches.erase(kGTestOutputFlag);
364
365 // Strip out gtest_repeat flag - this is handled by the launcher process. 361 // Strip out gtest_repeat flag - this is handled by the launcher process.
366 switches.erase(kGTestRepeatFlag); 362 switches.erase(kGTestRepeatFlag);
367 363
368 for (CommandLine::SwitchMap::const_iterator iter = switches.begin(); 364 for (CommandLine::SwitchMap::const_iterator iter = switches.begin();
369 iter != switches.end(); ++iter) { 365 iter != switches.end(); ++iter) {
370 new_command_line.AppendSwitchNative((*iter).first, (*iter).second); 366 new_command_line.AppendSwitchNative((*iter).first, (*iter).second);
371 } 367 }
372 368
373 // Prepend wrapper after last CommandLine quasi-copy operation. CommandLine 369 // Prepend wrapper after last CommandLine quasi-copy operation. CommandLine
374 // does not really support removing switches well, and trying to do that 370 // does not really support removing switches well, and trying to do that
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 438
443 // Special value "-1" means "repeat indefinitely". 439 // Special value "-1" means "repeat indefinitely".
444 if (cycles != -1) 440 if (cycles != -1)
445 cycles--; 441 cycles--;
446 } 442 }
447 443
448 return exit_code; 444 return exit_code;
449 } 445 }
450 446
451 } // namespace base 447 } // namespace base
OLDNEW
« no previous file with comments | « base/test/test_launcher.h ('k') | base/test/unit_test_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698