OLD | NEW |
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/unit_test_launcher.h" | 5 #include "base/test/launcher/unit_test_launcher.h" |
6 | 6 |
| 7 #include "base/base_switches.h" |
7 #include "base/bind.h" | 8 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
11 #include "base/debug/debugger.h" | 12 #include "base/debug/debugger.h" |
12 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
13 #include "base/files/scoped_temp_dir.h" | 14 #include "base/files/scoped_temp_dir.h" |
14 #include "base/format_macros.h" | 15 #include "base/format_macros.h" |
15 #include "base/location.h" | 16 #include "base/location.h" |
16 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 "Pass --test-launcher-debug-launcher to debug the launcher " | 174 "Pass --test-launcher-debug-launcher to debug the launcher " |
174 "itself.\n"); | 175 "itself.\n"); |
175 fflush(stdout); | 176 fflush(stdout); |
176 force_single_process = true; | 177 force_single_process = true; |
177 } | 178 } |
178 } | 179 } |
179 | 180 |
180 if (CommandLine::ForCurrentProcess()->HasSwitch(kGTestHelpFlag) || | 181 if (CommandLine::ForCurrentProcess()->HasSwitch(kGTestHelpFlag) || |
181 CommandLine::ForCurrentProcess()->HasSwitch(kGTestListTestsFlag) || | 182 CommandLine::ForCurrentProcess()->HasSwitch(kGTestListTestsFlag) || |
182 CommandLine::ForCurrentProcess()->HasSwitch(kSingleProcessTestsFlag) || | 183 CommandLine::ForCurrentProcess()->HasSwitch(kSingleProcessTestsFlag) || |
| 184 CommandLine::ForCurrentProcess()->HasSwitch( |
| 185 switches::kTestChildProcess) || |
183 force_single_process) { | 186 force_single_process) { |
184 return run_test_suite.Run(); | 187 return run_test_suite.Run(); |
185 } | 188 } |
186 #endif | 189 #endif |
187 | 190 |
188 if (CommandLine::ForCurrentProcess()->HasSwitch(kHelpFlag)) { | 191 if (CommandLine::ForCurrentProcess()->HasSwitch(kHelpFlag)) { |
189 PrintUsage(); | 192 PrintUsage(); |
190 return 0; | 193 return 0; |
191 } | 194 } |
192 | 195 |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 TestLauncher* test_launcher, | 580 TestLauncher* test_launcher, |
578 const std::vector<std::string>& test_names) { | 581 const std::vector<std::string>& test_names) { |
579 ThreadTaskRunnerHandle::Get()->PostTask( | 582 ThreadTaskRunnerHandle::Get()->PostTask( |
580 FROM_HERE, | 583 FROM_HERE, |
581 Bind(&RunUnitTestsSerially, test_launcher, platform_delegate_, test_names, | 584 Bind(&RunUnitTestsSerially, test_launcher, platform_delegate_, test_names, |
582 use_job_objects_ ? TestLauncher::USE_JOB_OBJECTS : 0)); | 585 use_job_objects_ ? TestLauncher::USE_JOB_OBJECTS : 0)); |
583 return test_names.size(); | 586 return test_names.size(); |
584 } | 587 } |
585 | 588 |
586 } // namespace base | 589 } // namespace base |
OLD | NEW |