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/test_launcher.h" | 5 #include "base/test/launcher/test_launcher.h" |
6 | 6 |
7 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 | 798 |
799 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 799 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
800 if (test_name.find("DISABLED") != std::string::npos) { | 800 if (test_name.find("DISABLED") != std::string::npos) { |
801 results_tracker_.AddDisabledTest(test_name); | 801 results_tracker_.AddDisabledTest(test_name); |
802 | 802 |
803 // Skip disabled tests unless explicitly requested. | 803 // Skip disabled tests unless explicitly requested. |
804 if (!command_line->HasSwitch(kGTestRunDisabledTestsFlag)) | 804 if (!command_line->HasSwitch(kGTestRunDisabledTestsFlag)) |
805 continue; | 805 continue; |
806 } | 806 } |
807 | 807 |
| 808 if (!launcher_delegate_->ShouldRunTest(test_case, test_info)) |
| 809 continue; |
| 810 |
808 // Skip the test that doesn't match the filter (if given). | 811 // Skip the test that doesn't match the filter (if given). |
809 if (!positive_test_filter_.empty()) { | 812 if (!positive_test_filter_.empty()) { |
810 bool found = false; | 813 bool found = false; |
811 for (size_t k = 0; k < positive_test_filter_.size(); ++k) { | 814 for (size_t k = 0; k < positive_test_filter_.size(); ++k) { |
812 if (MatchPattern(test_name, positive_test_filter_[k])) { | 815 if (MatchPattern(test_name, positive_test_filter_[k])) { |
813 found = true; | 816 found = true; |
814 break; | 817 break; |
815 } | 818 } |
816 } | 819 } |
817 | 820 |
818 if (!found) | 821 if (!found) |
819 continue; | 822 continue; |
820 } | 823 } |
821 bool excluded = false; | 824 bool excluded = false; |
822 for (size_t k = 0; k < negative_test_filter_.size(); ++k) { | 825 for (size_t k = 0; k < negative_test_filter_.size(); ++k) { |
823 if (MatchPattern(test_name, negative_test_filter_[k])) { | 826 if (MatchPattern(test_name, negative_test_filter_[k])) { |
824 excluded = true; | 827 excluded = true; |
825 break; | 828 break; |
826 } | 829 } |
827 } | 830 } |
828 if (excluded) | 831 if (excluded) |
829 continue; | 832 continue; |
830 | 833 |
831 if (!launcher_delegate_->ShouldRunTest(test_case, test_info)) | |
832 continue; | |
833 | |
834 if (base::Hash(test_name) % total_shards_ != | 834 if (base::Hash(test_name) % total_shards_ != |
835 static_cast<uint32>(shard_index_)) { | 835 static_cast<uint32>(shard_index_)) { |
836 continue; | 836 continue; |
837 } | 837 } |
838 | 838 |
839 test_names.push_back(test_name); | 839 test_names.push_back(test_name); |
840 } | 840 } |
841 } | 841 } |
842 | 842 |
843 test_started_count_ = launcher_delegate_->RunTests(this, test_names); | 843 test_started_count_ = launcher_delegate_->RunTests(this, test_names); |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 | 1094 |
1095 g_live_processes.Get().erase(process_handle); | 1095 g_live_processes.Get().erase(process_handle); |
1096 } | 1096 } |
1097 | 1097 |
1098 base::CloseProcessHandle(process_handle); | 1098 base::CloseProcessHandle(process_handle); |
1099 | 1099 |
1100 return exit_code; | 1100 return exit_code; |
1101 } | 1101 } |
1102 | 1102 |
1103 } // namespace base | 1103 } // namespace base |
OLD | NEW |