| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 fprintf(stdout, | 493 fprintf(stdout, |
| 494 "Valgrind detected, switching to single process mode.\n" | 494 "Valgrind detected, switching to single process mode.\n" |
| 495 "Pass --test-launcher-debug-launcher to valgrind the launcher " | 495 "Pass --test-launcher-debug-launcher to valgrind the launcher " |
| 496 "itself.\n"); | 496 "itself.\n"); |
| 497 fflush(stdout); | 497 fflush(stdout); |
| 498 force_single_process = true; | 498 force_single_process = true; |
| 499 } | 499 } |
| 500 } | 500 } |
| 501 | 501 |
| 502 if (CommandLine::ForCurrentProcess()->HasSwitch(kGTestHelpFlag) || | 502 if (CommandLine::ForCurrentProcess()->HasSwitch(kGTestHelpFlag) || |
| 503 CommandLine::ForCurrentProcess()->HasSwitch(kGTestListTestsFlag) || |
| 503 CommandLine::ForCurrentProcess()->HasSwitch(kSingleProcessTestsFlag) || | 504 CommandLine::ForCurrentProcess()->HasSwitch(kSingleProcessTestsFlag) || |
| 504 force_single_process) { | 505 force_single_process) { |
| 505 return run_test_suite.Run(); | 506 return run_test_suite.Run(); |
| 506 } | 507 } |
| 507 #endif | 508 #endif |
| 508 | 509 |
| 509 if (CommandLine::ForCurrentProcess()->HasSwitch(kHelpFlag)) { | 510 if (CommandLine::ForCurrentProcess()->HasSwitch(kHelpFlag)) { |
| 510 PrintUsage(); | 511 PrintUsage(); |
| 511 return 0; | 512 return 0; |
| 512 } | 513 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 argc, argv, run_test_suite, SysInfo::NumberOfProcessors()); | 551 argc, argv, run_test_suite, SysInfo::NumberOfProcessors()); |
| 551 } | 552 } |
| 552 | 553 |
| 553 int LaunchUnitTestsSerially(int argc, | 554 int LaunchUnitTestsSerially(int argc, |
| 554 char** argv, | 555 char** argv, |
| 555 const RunTestSuiteCallback& run_test_suite) { | 556 const RunTestSuiteCallback& run_test_suite) { |
| 556 return LaunchUnitTestsInternal(argc, argv, run_test_suite, 1); | 557 return LaunchUnitTestsInternal(argc, argv, run_test_suite, 1); |
| 557 } | 558 } |
| 558 | 559 |
| 559 } // namespace base | 560 } // namespace base |
| OLD | NEW |