| 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/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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 | 447 |
| 448 DCHECK(!command_line->HasSwitch(kGTestListTestsFlag)); | 448 DCHECK(!command_line->HasSwitch(kGTestListTestsFlag)); |
| 449 | 449 |
| 450 testing::UnitTest* const unit_test = testing::UnitTest::GetInstance(); | 450 testing::UnitTest* const unit_test = testing::UnitTest::GetInstance(); |
| 451 | 451 |
| 452 std::string filter = command_line->GetSwitchValueASCII(kGTestFilterFlag); | 452 std::string filter = command_line->GetSwitchValueASCII(kGTestFilterFlag); |
| 453 | 453 |
| 454 // Split --gtest_filter at '-', if there is one, to separate into | 454 // Split --gtest_filter at '-', if there is one, to separate into |
| 455 // positive filter and negative filter portions. | 455 // positive filter and negative filter portions. |
| 456 std::string positive_filter = filter; | 456 std::string positive_filter = filter; |
| 457 std::string negative_filter = ""; | 457 std::string negative_filter; |
| 458 size_t dash_pos = filter.find('-'); | 458 size_t dash_pos = filter.find('-'); |
| 459 if (dash_pos != std::string::npos) { | 459 if (dash_pos != std::string::npos) { |
| 460 positive_filter = filter.substr(0, dash_pos); // Everything up to the dash. | 460 positive_filter = filter.substr(0, dash_pos); // Everything up to the dash. |
| 461 negative_filter = filter.substr(dash_pos + 1); // Everything after the dash. | 461 negative_filter = filter.substr(dash_pos + 1); // Everything after the dash. |
| 462 } | 462 } |
| 463 | 463 |
| 464 int num_runnable_tests = 0; | 464 int num_runnable_tests = 0; |
| 465 int test_run_count = 0; | 465 int test_run_count = 0; |
| 466 int timeout_count = 0; | 466 int timeout_count = 0; |
| 467 std::vector<std::string> failed_tests; | 467 std::vector<std::string> failed_tests; |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 cycles--; | 744 cycles--; |
| 745 } | 745 } |
| 746 return exit_code; | 746 return exit_code; |
| 747 } | 747 } |
| 748 | 748 |
| 749 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { | 749 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { |
| 750 return g_launcher_delegate; | 750 return g_launcher_delegate; |
| 751 } | 751 } |
| 752 | 752 |
| 753 } // namespace content | 753 } // namespace content |
| OLD | NEW |