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

Unified Diff: sandbox/linux/tests/main.cc

Issue 2638763004: Report CHECK/DCHECK to test launcher summary output. (Closed)
Patch Set: Add test for assert handlers nesting. 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 | « net/tools/stress_cache/stress_cache.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/tests/main.cc
diff --git a/sandbox/linux/tests/main.cc b/sandbox/linux/tests/main.cc
index caeddee32cfac67a7d040150bd08977591698a5c..223a320405566f8ca04cdd4074293d97db1c8887 100644
--- a/sandbox/linux/tests/main.cc
+++ b/sandbox/linux/tests/main.cc
@@ -4,6 +4,7 @@
#include "base/at_exit.h"
#include "base/base_switches.h"
+#include "base/bind.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
@@ -37,7 +38,10 @@ void RunPostTestsChecks(const base::FilePath& orig_cwd) {
} // namespace sandbox
#if !defined(SANDBOX_USES_BASE_TEST_SUITE)
-void UnitTestAssertHandler(const std::string& str) {
+void UnitTestAssertHandler(const char* file,
+ int line,
+ const base::StringPiece message,
+ const base::StringPiece stack_trace) {
_exit(1);
}
#endif
@@ -64,7 +68,8 @@ int main(int argc, char* argv[]) {
// Death tests rely on LOG(FATAL) triggering an exit (the default behavior is
// SIGABRT). The normal test launcher does this at initialization, but since
// we still do not use this on Android, we must install the handler ourselves.
- logging::SetLogAssertHandler(UnitTestAssertHandler);
+ logging::ScopedLogAssertHandler scoped_assert_handler(
+ base::Bind(UnitTestAssertHandler));
#endif
// Always go through re-execution for death tests.
// This makes gtest only marginally slower for us and has the
« no previous file with comments | « net/tools/stress_cache/stress_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698