Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/test/test_launcher.h" | 5 #include "content/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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 439 for (int i = 0; i < unit_test->total_test_case_count(); ++i) { | 439 for (int i = 0; i < unit_test->total_test_case_count(); ++i) { |
| 440 const testing::TestCase* test_case = unit_test->GetTestCase(i); | 440 const testing::TestCase* test_case = unit_test->GetTestCase(i); |
| 441 TestCasePrinterHelper helper(printer, test_case->name(), | 441 TestCasePrinterHelper helper(printer, test_case->name(), |
| 442 test_case->total_test_count()); | 442 test_case->total_test_count()); |
| 443 for (int j = 0; j < test_case->total_test_count(); ++j) { | 443 for (int j = 0; j < test_case->total_test_count(); ++j) { |
| 444 const testing::TestInfo* test_info = test_case->GetTestInfo(j); | 444 const testing::TestInfo* test_info = test_case->GetTestInfo(j); |
| 445 std::string test_name = test_info->test_case_name(); | 445 std::string test_name = test_info->test_case_name(); |
| 446 test_name.append("."); | 446 test_name.append("."); |
| 447 test_name.append(test_info->name()); | 447 test_name.append(test_info->name()); |
| 448 | 448 |
| 449 // Skip our special test so it's not run twice. That confuses | 449 // Skip our special test so it's not run twice, unless it's the only test |
| 450 // the log parser. | 450 // being run, to avoid confusing the log parser. |
| 451 if (test_name == kEmptyTestName) | 451 if (test_name == kEmptyTestName && positive_filter != kEmptyTestName) |
| 452 continue; | 452 continue; |
| 453 | 453 |
| 454 // Skip disabled tests. | 454 // Skip disabled tests. |
| 455 if (test_name.find("DISABLED") != std::string::npos && | 455 if (test_name.find("DISABLED") != std::string::npos && |
| 456 !command_line->HasSwitch(kGTestRunDisabledTestsFlag)) { | 456 !command_line->HasSwitch(kGTestRunDisabledTestsFlag)) { |
| 457 printer.OnTestEnd(test_info->name(), test_case->name(), | 457 printer.OnTestEnd(test_info->name(), test_case->name(), |
| 458 false, false, false, 0); | 458 false, false, false, 0); |
| 459 continue; | 459 continue; |
| 460 } | 460 } |
| 461 | 461 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 630 TestTimeouts::Initialize(); | 630 TestTimeouts::Initialize(); |
| 631 int exit_code = 0; | 631 int exit_code = 0; |
| 632 | 632 |
| 633 // Make sure the entire browser code is loaded into memory. Reading it | 633 // Make sure the entire browser code is loaded into memory. Reading it |
| 634 // from disk may be slow on a busy bot, and can easily exceed the default | 634 // from disk may be slow on a busy bot, and can easily exceed the default |
| 635 // timeout causing flaky test failures. Use an empty test that only starts | 635 // timeout causing flaky test failures. Use an empty test that only starts |
| 636 // and closes a browser with a long timeout to avoid those problems. | 636 // and closes a browser with a long timeout to avoid those problems. |
| 637 // NOTE: we don't do this when specifying a filter because this slows down the | 637 // NOTE: we don't do this when specifying a filter because this slows down the |
| 638 // common case of running one test locally, and also on trybots when sharding | 638 // common case of running one test locally, and also on trybots when sharding |
| 639 // as this one test runs ~200 times and wastes a few minutes. | 639 // as this one test runs ~200 times and wastes a few minutes. |
| 640 if (!should_shard && !command_line->HasSwitch(kGTestFilterFlag)) { | 640 if (!should_shard && !command_line->HasSwitch(kGTestFilterFlag)) { |
|
Paweł Hajdan Jr.
2012/06/04 10:28:16
I think the right place to fix it is here. Remove
mmenke
2012/06/04 14:38:11
Done (Well...Mostly. I kept the "!command_line->H
mmenke
2012/06/04 14:57:19
Err...Wait... How are tests sharded across multip
mmenke
2012/06/04 14:59:42
Ah, |total_slaves|. Saw that before, but forgot a
| |
| 641 exit_code = RunTest(launcher_delegate, | 641 exit_code = RunTest(launcher_delegate, |
| 642 kEmptyTestName, | 642 kEmptyTestName, |
| 643 TestTimeouts::large_test_timeout_ms(), | 643 TestTimeouts::large_test_timeout_ms(), |
| 644 NULL); | 644 NULL); |
| 645 if (exit_code != 0) | 645 if (exit_code != 0) |
| 646 return exit_code; | 646 return exit_code; |
| 647 } | 647 } |
| 648 | 648 |
| 649 int cycles = 1; | 649 int cycles = 1; |
| 650 if (command_line->HasSwitch(kGTestRepeatFlag)) { | 650 if (command_line->HasSwitch(kGTestRepeatFlag)) { |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 662 } | 662 } |
| 663 | 663 |
| 664 // Special value "-1" means "repeat indefinitely". | 664 // Special value "-1" means "repeat indefinitely". |
| 665 if (cycles != -1) | 665 if (cycles != -1) |
| 666 cycles--; | 666 cycles--; |
| 667 } | 667 } |
| 668 return exit_code; | 668 return exit_code; |
| 669 } | 669 } |
| 670 | 670 |
| 671 } // namespace test_launcher | 671 } // namespace test_launcher |
| OLD | NEW |