| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/test/test_launcher/test_runner.h" | 5 #include "chrome/test/test_launcher/test_runner.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 continue; | 230 continue; |
| 231 } | 231 } |
| 232 base::Time start_time = base::Time::Now(); | 232 base::Time start_time = base::Time::Now(); |
| 233 scoped_ptr<TestRunner> test_runner( | 233 scoped_ptr<TestRunner> test_runner( |
| 234 test_runner_factory.CreateTestRunner()); | 234 test_runner_factory.CreateTestRunner()); |
| 235 if (!test_runner.get() || !test_runner->Init()) | 235 if (!test_runner.get() || !test_runner->Init()) |
| 236 return false; | 236 return false; |
| 237 ++test_run_count; | 237 ++test_run_count; |
| 238 if (!test_runner->RunTest(test_name.c_str())) { | 238 if (!test_runner->RunTest(test_name.c_str())) { |
| 239 failed_tests.push_back(test_name); | 239 failed_tests.push_back(test_name); |
| 240 bool ignore_failure = base::TestSuite::ShouldIgnoreFailure(*test_info); | 240 bool ignore_failure = TestSuite::ShouldIgnoreFailure(*test_info); |
| 241 printer.OnTestEnd(test_info->name(), test_case->name(), true, true, | 241 printer.OnTestEnd(test_info->name(), test_case->name(), true, true, |
| 242 ignore_failure, | 242 ignore_failure, |
| 243 (base::Time::Now() - start_time).InMillisecondsF()); | 243 (base::Time::Now() - start_time).InMillisecondsF()); |
| 244 if (ignore_failure) | 244 if (ignore_failure) |
| 245 ++ignored_failure_count; | 245 ++ignored_failure_count; |
| 246 } else { | 246 } else { |
| 247 printer.OnTestEnd(test_info->name(), test_case->name(), true, false, | 247 printer.OnTestEnd(test_info->name(), test_case->name(), true, false, |
| 248 false, | 248 false, |
| 249 (base::Time::Now() - start_time).InMillisecondsF()); | 249 (base::Time::Now() - start_time).InMillisecondsF()); |
| 250 } | 250 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 261 printf("Failing tests:\n"); | 261 printf("Failing tests:\n"); |
| 262 for (std::vector<std::string>::const_iterator iter = failed_tests.begin(); | 262 for (std::vector<std::string>::const_iterator iter = failed_tests.begin(); |
| 263 iter != failed_tests.end(); ++iter) { | 263 iter != failed_tests.end(); ++iter) { |
| 264 printf("%s\n", iter->c_str()); | 264 printf("%s\n", iter->c_str()); |
| 265 } | 265 } |
| 266 | 266 |
| 267 return false; | 267 return false; |
| 268 } | 268 } |
| 269 | 269 |
| 270 } // namespace | 270 } // namespace |
| OLD | NEW |