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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 results_tracker_.AddGlobalTag("CPU_64_BITS"); | 890 results_tracker_.AddGlobalTag("CPU_64_BITS"); |
891 #endif | 891 #endif |
892 | 892 |
893 return true; | 893 return true; |
894 } | 894 } |
895 | 895 |
896 void TestLauncher::RunTests() { | 896 void TestLauncher::RunTests() { |
897 std::vector<std::string> test_names; | 897 std::vector<std::string> test_names; |
898 for (size_t i = 0; i < tests_.size(); i++) { | 898 for (size_t i = 0; i < tests_.size(); i++) { |
899 std::string test_name = FormatFullTestName( | 899 std::string test_name = FormatFullTestName( |
900 tests_[i].first, tests_[i].second); | 900 tests_[i].test_case_name, tests_[i].test_name); |
901 | 901 |
902 results_tracker_.AddTest(test_name); | 902 results_tracker_.AddTest(test_name, tests_[i].file, tests_[i].line); |
903 | 903 |
904 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 904 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
905 if (test_name.find("DISABLED") != std::string::npos) { | 905 if (test_name.find("DISABLED") != std::string::npos) { |
906 results_tracker_.AddDisabledTest(test_name); | 906 results_tracker_.AddDisabledTest(test_name); |
907 | 907 |
908 // Skip disabled tests unless explicitly requested. | 908 // Skip disabled tests unless explicitly requested. |
909 if (!command_line->HasSwitch(kGTestRunDisabledTestsFlag)) | 909 if (!command_line->HasSwitch(kGTestRunDisabledTestsFlag)) |
910 continue; | 910 continue; |
911 } | 911 } |
912 | 912 |
913 if (!launcher_delegate_->ShouldRunTest(tests_[i].first, tests_[i].second)) | 913 if (!launcher_delegate_->ShouldRunTest( |
| 914 tests_[i].test_case_name, tests_[i].test_name)) { |
914 continue; | 915 continue; |
| 916 } |
915 | 917 |
916 // Skip the test that doesn't match the filter (if given). | 918 // Skip the test that doesn't match the filter (if given). |
917 if (!positive_test_filter_.empty()) { | 919 if (!positive_test_filter_.empty()) { |
918 bool found = false; | 920 bool found = false; |
919 for (size_t k = 0; k < positive_test_filter_.size(); ++k) { | 921 for (size_t k = 0; k < positive_test_filter_.size(); ++k) { |
920 if (MatchPattern(test_name, positive_test_filter_[k])) { | 922 if (MatchPattern(test_name, positive_test_filter_[k])) { |
921 found = true; | 923 found = true; |
922 break; | 924 break; |
923 } | 925 } |
924 } | 926 } |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 } | 1073 } |
1072 | 1074 |
1073 std::string snippet(full_output.substr(run_pos)); | 1075 std::string snippet(full_output.substr(run_pos)); |
1074 if (end_pos != std::string::npos) | 1076 if (end_pos != std::string::npos) |
1075 snippet = full_output.substr(run_pos, end_pos - run_pos); | 1077 snippet = full_output.substr(run_pos, end_pos - run_pos); |
1076 | 1078 |
1077 return snippet; | 1079 return snippet; |
1078 } | 1080 } |
1079 | 1081 |
1080 } // namespace base | 1082 } // namespace base |
OLD | NEW |