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 "base/test/test_suite.h" | 5 #include "base/test/test_suite.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // because other platforms don't separate out the relevant logs in the same | 232 // because other platforms don't separate out the relevant logs in the same |
233 // way. | 233 // way. |
234 const ::testing::TestInfo* const test_info = | 234 const ::testing::TestInfo* const test_info = |
235 ::testing::UnitTest::GetInstance()->current_test_info(); | 235 ::testing::UnitTest::GetInstance()->current_test_info(); |
236 if (test_info) { | 236 if (test_info) { |
237 LOG(ERROR) << "Currently running: " << test_info->test_case_name() << "." | 237 LOG(ERROR) << "Currently running: " << test_info->test_case_name() << "." |
238 << test_info->name(); | 238 << test_info->name(); |
239 fflush(stderr); | 239 fflush(stderr); |
240 } | 240 } |
241 #endif // defined(OS_ANDROID) | 241 #endif // defined(OS_ANDROID) |
242 RAW_LOG(FATAL, str.c_str()); | 242 |
| 243 // The logging system actually prints the message before calling the assert |
| 244 // handler. Just exit now to avoid printing too many stack traces. |
| 245 _exit(1); |
243 } | 246 } |
244 | 247 |
245 void TestSuite::SuppressErrorDialogs() { | 248 void TestSuite::SuppressErrorDialogs() { |
246 #if defined(OS_WIN) | 249 #if defined(OS_WIN) |
247 UINT new_flags = SEM_FAILCRITICALERRORS | | 250 UINT new_flags = SEM_FAILCRITICALERRORS | |
248 SEM_NOGPFAULTERRORBOX | | 251 SEM_NOGPFAULTERRORBOX | |
249 SEM_NOOPENFILEERRORBOX; | 252 SEM_NOOPENFILEERRORBOX; |
250 | 253 |
251 // Preserve existing error mode, as discussed at | 254 // Preserve existing error mode, as discussed at |
252 // http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx | 255 // http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 ResetCommandLine(); | 314 ResetCommandLine(); |
312 #if !defined(OS_IOS) | 315 #if !defined(OS_IOS) |
313 AddTestLauncherResultPrinter(); | 316 AddTestLauncherResultPrinter(); |
314 #endif // !defined(OS_IOS) | 317 #endif // !defined(OS_IOS) |
315 | 318 |
316 TestTimeouts::Initialize(); | 319 TestTimeouts::Initialize(); |
317 } | 320 } |
318 | 321 |
319 void TestSuite::Shutdown() { | 322 void TestSuite::Shutdown() { |
320 } | 323 } |
OLD | NEW |