Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: base/test/test_suite.cc

Issue 134133002: Avoid printing three stack traces on CHECK failure. Print just one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698