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

Unified Diff: util/test/multiprocess.h

Issue 1000653002: test::Multiprocess: exit cleanly from children with _exit() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 9 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 | « no previous file | util/test/multiprocess_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/test/multiprocess.h
diff --git a/util/test/multiprocess.h b/util/test/multiprocess.h
index e5d71dd5bdbea857729d584a11bda57cc9c61a5b..0672b7aa628c66933638b8e41980bc892a3c0138 100644
--- a/util/test/multiprocess.h
+++ b/util/test/multiprocess.h
@@ -164,9 +164,9 @@ class Multiprocess {
//! \brief Runs the child side of the test.
//!
//! This method establishes the child’s environment, calls
- //! MultiprocessChild(), and exits cleanly. However, if any failure (via fatal
- //! or nonfatal gtest assertion) is detected, the child will exit with a
- //! failure status.
+ //! MultiprocessChild(), and exits cleanly by calling `_exit(0)`. However, if
+ //! any failure (via fatal or nonfatal gtest assertion) is detected, the child
+ //! will exit with a failure status.
void RunChild();
//! \brief The subclass-provided parent routine.
@@ -186,6 +186,11 @@ class Multiprocess {
//! `FAIL()`, etc.
//!
//! Subclasses must implement this method to define how the child operates.
+ //! Subclasses may exit with a failure status by using `LOG(FATAL)`,
+ //! `abort()`, or similar. They may exit cleanly by returning from this method
+ //! or by calling `_exit(0)`. Under no circumstances may `exit()` be called
+ //! by the child without having the child process `exec()`. Use
+ //! MultiprocessExec if the child should call `exec()`.
virtual void MultiprocessChild() = 0;
internal::MultiprocessInfo* info_;
« no previous file with comments | « no previous file | util/test/multiprocess_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698