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

Side by Side Diff: content/public/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 | « content/content_browser.gypi ('k') | third_party/libxml/chromium/libxml_utils.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/public/test/test_launcher.h" 5 #include "content/public/test/test_launcher.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 pre_test_name, 79 pre_test_name,
80 command_line, 80 command_line,
81 default_timeout, 81 default_timeout,
82 was_timeout); 82 was_timeout);
83 if (exit_code != 0) 83 if (exit_code != 0)
84 return exit_code; 84 return exit_code;
85 } 85 }
86 } 86 }
87 } 87 }
88 88
89 CommandLine new_cmd_line(command_line); 89 CommandLine new_cmd_line(command_line.GetProgram());
90 CommandLine::SwitchMap switches = command_line.GetSwitches();
91
92 // Strip out gtest_output flag because otherwise we would overwrite results
93 // of the other tests.
94 switches.erase(base::kGTestOutputFlag);
95
96 for (CommandLine::SwitchMap::const_iterator iter = switches.begin();
97 iter != switches.end(); ++iter) {
98 new_cmd_line.AppendSwitchNative(iter->first, iter->second);
99 }
90 100
91 // Always enable disabled tests. This method is not called with disabled 101 // Always enable disabled tests. This method is not called with disabled
92 // tests unless this flag was specified to the browser test executable. 102 // tests unless this flag was specified to the browser test executable.
93 new_cmd_line.AppendSwitch("gtest_also_run_disabled_tests"); 103 new_cmd_line.AppendSwitch("gtest_also_run_disabled_tests");
94 new_cmd_line.AppendSwitchASCII("gtest_filter", test_name); 104 new_cmd_line.AppendSwitchASCII("gtest_filter", test_name);
95 new_cmd_line.AppendSwitch(kSingleProcessTestsFlag); 105 new_cmd_line.AppendSwitch(kSingleProcessTestsFlag);
96 106
97 char* browser_wrapper = getenv("BROWSER_WRAPPER"); 107 char* browser_wrapper = getenv("BROWSER_WRAPPER");
98 int exit_code = base::LaunchChildGTestProcess( 108 int exit_code = base::LaunchChildGTestProcess(
99 new_cmd_line, 109 new_cmd_line,
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 352
343 WrapperTestLauncherDelegate delegate(launcher_delegate); 353 WrapperTestLauncherDelegate delegate(launcher_delegate);
344 return base::LaunchTests(&delegate, argc, argv); 354 return base::LaunchTests(&delegate, argc, argv);
345 } 355 }
346 356
347 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { 357 TestLauncherDelegate* GetCurrentTestLauncherDelegate() {
348 return g_launcher_delegate; 358 return g_launcher_delegate;
349 } 359 }
350 360
351 } // namespace content 361 } // namespace content
OLDNEW
« no previous file with comments | « content/content_browser.gypi ('k') | third_party/libxml/chromium/libxml_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698