| 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 fflush(stdout); | 472 fflush(stdout); |
| 473 } else { | 473 } else { |
| 474 if (base::debug::BeingDebugged()) { | 474 if (base::debug::BeingDebugged()) { |
| 475 fprintf(stdout, | 475 fprintf(stdout, |
| 476 "Debugger detected, switching to single process mode.\n" | 476 "Debugger detected, switching to single process mode.\n" |
| 477 "Pass --test-launcher-debug-launcher to debug the launcher " | 477 "Pass --test-launcher-debug-launcher to debug the launcher " |
| 478 "itself.\n"); | 478 "itself.\n"); |
| 479 fflush(stdout); | 479 fflush(stdout); |
| 480 force_single_process = true; | 480 force_single_process = true; |
| 481 } | 481 } |
| 482 | |
| 483 if (RunningOnValgrind()) { | |
| 484 fprintf(stdout, | |
| 485 "Valgrind detected, switching to single process mode.\n" | |
| 486 "Pass --test-launcher-debug-launcher to valgrind the launcher " | |
| 487 "itself.\n"); | |
| 488 fflush(stdout); | |
| 489 force_single_process = true; | |
| 490 } | |
| 491 } | 482 } |
| 492 | 483 |
| 493 if (CommandLine::ForCurrentProcess()->HasSwitch(kGTestHelpFlag) || | 484 if (CommandLine::ForCurrentProcess()->HasSwitch(kGTestHelpFlag) || |
| 494 CommandLine::ForCurrentProcess()->HasSwitch(kGTestListTestsFlag) || | 485 CommandLine::ForCurrentProcess()->HasSwitch(kGTestListTestsFlag) || |
| 495 CommandLine::ForCurrentProcess()->HasSwitch(kSingleProcessTestsFlag) || | 486 CommandLine::ForCurrentProcess()->HasSwitch(kSingleProcessTestsFlag) || |
| 496 force_single_process) { | 487 force_single_process) { |
| 497 return run_test_suite.Run(); | 488 return run_test_suite.Run(); |
| 498 } | 489 } |
| 499 #endif | 490 #endif |
| 500 | 491 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 CommandLine::Init(argc, NULL); | 567 CommandLine::Init(argc, NULL); |
| 577 return LaunchUnitTestsInternal( | 568 return LaunchUnitTestsInternal( |
| 578 run_test_suite, | 569 run_test_suite, |
| 579 SysInfo::NumberOfProcessors(), | 570 SysInfo::NumberOfProcessors(), |
| 580 use_job_objects, | 571 use_job_objects, |
| 581 Bind(&InitGoogleTestWChar, &argc, argv)); | 572 Bind(&InitGoogleTestWChar, &argc, argv)); |
| 582 } | 573 } |
| 583 #endif // defined(OS_WIN) | 574 #endif // defined(OS_WIN) |
| 584 | 575 |
| 585 } // namespace base | 576 } // namespace base |
| OLD | NEW |