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

Unified Diff: base/test/test_suite.cc

Issue 2828373002: Revert of Report CHECK/DCHECK to test launcher summary output. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/test_suite.h ('k') | chrome/common/logging_chrome.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/test_suite.cc
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc
index c9bfe9e0f0173558f90130aead0fabe5b8370864..6f4cc372cb86ad73f9388740e5a9f0c05652cc88 100644
--- a/base/test/test_suite.cc
+++ b/base/test/test_suite.cc
@@ -238,11 +238,11 @@
return;
}
- printer_ = new XmlUnitTestResultPrinter;
- CHECK(printer_->Initialize(output_path));
+ XmlUnitTestResultPrinter* printer = new XmlUnitTestResultPrinter;
+ CHECK(printer->Initialize(output_path));
testing::TestEventListeners& listeners =
testing::UnitTest::GetInstance()->listeners();
- listeners.Append(printer_);
+ listeners.Append(printer);
}
// Don't add additional code to this method. Instead add it to
@@ -282,10 +282,8 @@
return result;
}
-void TestSuite::UnitTestAssertHandler(const char* file,
- int line,
- const base::StringPiece summary,
- const base::StringPiece stack_trace) {
+// static
+void TestSuite::UnitTestAssertHandler(const std::string& str) {
#if defined(OS_ANDROID)
// Correlating test stdio with logcat can be difficult, so we emit this
// helpful little hint about what was running. Only do this for Android
@@ -300,16 +298,6 @@
}
#endif // defined(OS_ANDROID)
- // XmlUnitTestResultPrinter inherits gtest format, where assert has summary
- // and message. In GTest, summary is just a logged text, and message is a
- // logged text, concatenated with stack trace of assert.
- // Concatenate summary and stack_trace here, to pass it as a message.
- if (printer_) {
- const std::string summary_str = summary.as_string();
- const std::string stack_trace_str = summary_str + stack_trace.as_string();
- printer_->OnAssert(file, line, summary_str, stack_trace_str);
- }
-
// The logging system actually prints the message before calling the assert
// handler. Just exit now to avoid printing too many stack traces.
_exit(1);
@@ -371,8 +359,7 @@
!CommandLine::ForCurrentProcess()->HasSwitch("show-error-dialogs")) {
SuppressErrorDialogs();
debug::SetSuppressDebugUI(true);
- assert_handler_ = base::MakeUnique<logging::ScopedLogAssertHandler>(
- base::Bind(&TestSuite::UnitTestAssertHandler, base::Unretained(this)));
+ logging::SetLogAssertHandler(UnitTestAssertHandler);
}
base::test::InitializeICUForTesting();
« no previous file with comments | « base/test/test_suite.h ('k') | chrome/common/logging_chrome.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698