blob: fd811309306f6cb7ea1216d3250a527fd65e5b85 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Crashpad: crashpad::test::Multiprocess Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="crashpad_doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Crashpad
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacecrashpad.html">crashpad</a></li><li class="navelem"><a class="el" href="namespacecrashpad_1_1test.html">test</a></li><li class="navelem"><a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html">Multiprocess</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classcrashpad_1_1test_1_1Multiprocess-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">crashpad::test::Multiprocess Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p>Manages a multiprocess test.
<a href="classcrashpad_1_1test_1_1Multiprocess.html#details">More...</a></p>
<p><code>#include &quot;test/multiprocess.h&quot;</code></p>
<div class="dynheader">
Inheritance diagram for crashpad::test::Multiprocess:</div>
<div class="dyncontent">
<div class="center">
<img src="classcrashpad_1_1test_1_1Multiprocess.png" usemap="#crashpad::test::Multiprocess_map" alt=""/>
<map id="crashpad::test::Multiprocess_map" name="crashpad::test::Multiprocess_map">
<area href="classcrashpad_1_1test_1_1MachMultiprocess.html" title="Manages a Mach-aware multiprocess test." alt="crashpad::test::MachMultiprocess" shape="rect" coords="0,56,200,80"/>
<area href="classcrashpad_1_1test_1_1MultiprocessExec.html" title="Manages an exec()-based multiprocess test." alt="crashpad::test::MultiprocessExec" shape="rect" coords="210,56,410,80"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:adedaaa5fbbb57de1ae5af8ef7c84b4bf"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#adedaaa5fbbb57de1ae5af8ef7c84b4bf">TerminationReason</a> : bool </td></tr>
<tr class="memdesc:adedaaa5fbbb57de1ae5af8ef7c84b4bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">The termination type for a child process. <a href="classcrashpad_1_1test_1_1Multiprocess.html#adedaaa5fbbb57de1ae5af8ef7c84b4bf">More...</a><br /></td></tr>
<tr class="separator:adedaaa5fbbb57de1ae5af8ef7c84b4bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a801aa7a78b2254c31c3ef7e0b24208e3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#a801aa7a78b2254c31c3ef7e0b24208e3">Run</a> ()</td></tr>
<tr class="memdesc:a801aa7a78b2254c31c3ef7e0b24208e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Runs the test. <a href="classcrashpad_1_1test_1_1Multiprocess.html#a801aa7a78b2254c31c3ef7e0b24208e3">More...</a><br /></td></tr>
<tr class="separator:a801aa7a78b2254c31c3ef7e0b24208e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a564b4c38239fc991d17c865deaf3c9cf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#a564b4c38239fc991d17c865deaf3c9cf">SetExpectedChildTermination</a> (<a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#adedaaa5fbbb57de1ae5af8ef7c84b4bf">TerminationReason</a> reason, ReturnCodeType code)</td></tr>
<tr class="memdesc:a564b4c38239fc991d17c865deaf3c9cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the expected termination reason and code. <a href="classcrashpad_1_1test_1_1Multiprocess.html#a564b4c38239fc991d17c865deaf3c9cf">More...</a><br /></td></tr>
<tr class="separator:a564b4c38239fc991d17c865deaf3c9cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc2bc24e4acfa5833936e0b7e97b91c8"><td class="memItemLeft" align="right" valign="top"><a id="acc2bc24e4acfa5833936e0b7e97b91c8"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#acc2bc24e4acfa5833936e0b7e97b91c8">SetExpectedChildTerminationBuiltinTrap</a> ()</td></tr>
<tr class="memdesc:acc2bc24e4acfa5833936e0b7e97b91c8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets termination reason and code appropriately for a child that terminates via <code>__builtin_trap()</code>. <br /></td></tr>
<tr class="separator:acc2bc24e4acfa5833936e0b7e97b91c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a122d18401346cf600a4f6ab63d83c8ca"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#a122d18401346cf600a4f6ab63d83c8ca">PreFork</a> ()</td></tr>
<tr class="memdesc:a122d18401346cf600a4f6ab63d83c8ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Establishes the proper testing environment prior to forking. <a href="classcrashpad_1_1test_1_1Multiprocess.html#a122d18401346cf600a4f6ab63d83c8ca">More...</a><br /></td></tr>
<tr class="separator:a122d18401346cf600a4f6ab63d83c8ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abff853ba6c2c4e88c4c759fccc287b94"><td class="memItemLeft" align="right" valign="top">pid_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#abff853ba6c2c4e88c4c759fccc287b94">ChildPID</a> () const</td></tr>
<tr class="memdesc:abff853ba6c2c4e88c4c759fccc287b94"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the child process’&#160;process ID. <a href="classcrashpad_1_1test_1_1Multiprocess.html#abff853ba6c2c4e88c4c759fccc287b94">More...</a><br /></td></tr>
<tr class="separator:abff853ba6c2c4e88c4c759fccc287b94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a208b33d3006abfd8e024430c510aa117"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacecrashpad.html#a07f8e33c4fdeba3783277f9f2563e48a">FileHandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#a208b33d3006abfd8e024430c510aa117">ReadPipeHandle</a> () const</td></tr>
<tr class="memdesc:a208b33d3006abfd8e024430c510aa117"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the read pipe’s file handle. <a href="classcrashpad_1_1test_1_1Multiprocess.html#a208b33d3006abfd8e024430c510aa117">More...</a><br /></td></tr>
<tr class="separator:a208b33d3006abfd8e024430c510aa117"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1ecd18814f4be49eedfe1dc076e1500"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacecrashpad.html#a07f8e33c4fdeba3783277f9f2563e48a">FileHandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#ab1ecd18814f4be49eedfe1dc076e1500">WritePipeHandle</a> () const</td></tr>
<tr class="memdesc:ab1ecd18814f4be49eedfe1dc076e1500"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the write pipe’s file handle. <a href="classcrashpad_1_1test_1_1Multiprocess.html#ab1ecd18814f4be49eedfe1dc076e1500">More...</a><br /></td></tr>
<tr class="separator:ab1ecd18814f4be49eedfe1dc076e1500"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89ec1079c25eca71250ff3ccf8ec2b72"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#a89ec1079c25eca71250ff3ccf8ec2b72">CloseReadPipe</a> ()</td></tr>
<tr class="memdesc:a89ec1079c25eca71250ff3ccf8ec2b72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Closes the read pipe. <a href="classcrashpad_1_1test_1_1Multiprocess.html#a89ec1079c25eca71250ff3ccf8ec2b72">More...</a><br /></td></tr>
<tr class="separator:a89ec1079c25eca71250ff3ccf8ec2b72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d7a2037501f89d4d8aa3099285b7ae9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#a9d7a2037501f89d4d8aa3099285b7ae9">CloseWritePipe</a> ()</td></tr>
<tr class="memdesc:a9d7a2037501f89d4d8aa3099285b7ae9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Closes the write pipe. <a href="classcrashpad_1_1test_1_1Multiprocess.html#a9d7a2037501f89d4d8aa3099285b7ae9">More...</a><br /></td></tr>
<tr class="separator:a9d7a2037501f89d4d8aa3099285b7ae9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af170901b8c26c3c24fc82419df305e1c"><td class="memItemLeft" align="right" valign="top"><a id="af170901b8c26c3c24fc82419df305e1c"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>set_info</b> (<a class="el" href="structcrashpad_1_1test_1_1internal_1_1MultiprocessInfo.html">internal::MultiprocessInfo</a> *info)</td></tr>
<tr class="separator:af170901b8c26c3c24fc82419df305e1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21d17479b00152c3511de0b6d87c8727"><td class="memItemLeft" align="right" valign="top"><a id="a21d17479b00152c3511de0b6d87c8727"></a>
<a class="el" href="structcrashpad_1_1test_1_1internal_1_1MultiprocessInfo.html">internal::MultiprocessInfo</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>info</b> ()</td></tr>
<tr class="separator:a21d17479b00152c3511de0b6d87c8727"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Manages a multiprocess test. </p>
<p>These tests are <code>fork()</code>-based. The parent and child processes are able to communicate via a pair of POSIX pipes.</p>
<p>Subclasses are expected to implement the parent and child by overriding the appropriate methods.</p>
<p>On Windows and Fuchsia, this class is only an internal implementation detail of <a class="el" href="classcrashpad_1_1test_1_1MultiprocessExec.html" title="Manages an exec()-based multiprocess test.">MultiprocessExec</a> and all tests must use that class. </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="adedaaa5fbbb57de1ae5af8ef7c84b4bf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adedaaa5fbbb57de1ae5af8ef7c84b4bf">&#9670;&nbsp;</a></span>TerminationReason</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#adedaaa5fbbb57de1ae5af8ef7c84b4bf">crashpad::test::Multiprocess::TerminationReason</a> : bool</td>
</tr>
</table>
</div><div class="memdoc">
<p>The termination type for a child process. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="adedaaa5fbbb57de1ae5af8ef7c84b4bfa9ac04c5400b6051e164ef9bcbb8c111a"></a>kTerminationNormal&#160;</td><td class="fielddoc"><p>The child terminated normally. </p>
<pre class="fragment">A normal return happens when a test returns from RunChild(), or for
tests that `exec()`, returns from `main()`. This also happens for tests
that call `exit()` or `_exit()`.
</pre> </td></tr>
<tr><td class="fieldname"><a id="adedaaa5fbbb57de1ae5af8ef7c84b4bfa4a97a5b85c823c3404d160ca615f491c"></a>kTerminationSignal&#160;</td><td class="fielddoc"><p>The child terminated by signal. </p>
<pre class="fragment">Signal termination happens as a result of a crash, a call to `abort()`,
assertion failure (including gtest assertions), etc.
</pre> </td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="abff853ba6c2c4e88c4c759fccc287b94"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abff853ba6c2c4e88c4c759fccc287b94">&#9670;&nbsp;</a></span>ChildPID()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">pid_t crashpad::test::Multiprocess::ChildPID </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the child process’&#160;process ID. </p>
<p>This method may only be called by the parent process. </p>
</div>
</div>
<a id="a89ec1079c25eca71250ff3ccf8ec2b72"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a89ec1079c25eca71250ff3ccf8ec2b72">&#9670;&nbsp;</a></span>CloseReadPipe()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void crashpad::test::Multiprocess::CloseReadPipe </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Closes the read pipe. </p>
<p>This method may be called by either the parent or the child process. An attempt to write to the write pipe in the partner process will fail with <code>EPIPE</code> or <code>SIGPIPE</code>. <a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#a208b33d3006abfd8e024430c510aa117" title="Returns the read pipe’s file handle.">ReadPipeHandle()</a> must not be called after this. </p>
</div>
</div>
<a id="a9d7a2037501f89d4d8aa3099285b7ae9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d7a2037501f89d4d8aa3099285b7ae9">&#9670;&nbsp;</a></span>CloseWritePipe()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void crashpad::test::Multiprocess::CloseWritePipe </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Closes the write pipe. </p>
<p>This method may be called by either the parent or the child process. An attempt to read from the read pipe in the partner process will indicate end-of-file. <a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#ab1ecd18814f4be49eedfe1dc076e1500" title="Returns the write pipe’s file handle.">WritePipeHandle()</a> must not be called after this. </p>
</div>
</div>
<a id="a122d18401346cf600a4f6ab63d83c8ca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a122d18401346cf600a4f6ab63d83c8ca">&#9670;&nbsp;</a></span>PreFork()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void crashpad::test::Multiprocess::PreFork </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Establishes the proper testing environment prior to forking. </p>
<p>Subclasses that solely implement a test should not need to override this method. Subclasses that do not implement tests but instead implement additional testing features on top of this class may override this method provided that they call the superclass’ implementation first as follows:</p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> <a class="code" href="classcrashpad_1_1test_1_1Multiprocess.html#a122d18401346cf600a4f6ab63d83c8ca">PreFork</a>()<span class="keyword"> override </span>{</div>
<div class="line"> ASSERT_NO_FATAL_FAILURE(<a class="code" href="classcrashpad_1_1test_1_1Multiprocess.html#a122d18401346cf600a4f6ab63d83c8ca">Multiprocess::PreFork</a>());</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Place subclass-specific pre-fork code here.</span></div>
<div class="line">}</div>
</div><!-- fragment --><p>Subclass implementations may signal failure by raising their own fatal gtest assertions. </p>
<p>Reimplemented in <a class="el" href="classcrashpad_1_1test_1_1MultiprocessExec.html#a4fbe35bfe7dd75624b417c435ae2208b">crashpad::test::MultiprocessExec</a>, and <a class="el" href="classcrashpad_1_1test_1_1MachMultiprocess.html#aac4af4a4c943686538069de230fe7abe">crashpad::test::MachMultiprocess</a>.</p>
</div>
</div>
<a id="a208b33d3006abfd8e024430c510aa117"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a208b33d3006abfd8e024430c510aa117">&#9670;&nbsp;</a></span>ReadPipeHandle()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespacecrashpad.html#a07f8e33c4fdeba3783277f9f2563e48a">FileHandle</a> crashpad::test::Multiprocess::ReadPipeHandle </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the read pipe’s file handle. </p>
<p>This method may be called by either the parent or the child process. Anything written to the write pipe in the partner process will appear on this file handle in this process.</p>
<p>It is an error to call this after <a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#a89ec1079c25eca71250ff3ccf8ec2b72" title="Closes the read pipe.">CloseReadPipe()</a> has been called.</p>
<dl class="section return"><dt>Returns</dt><dd>The read pipe’s file handle. </dd></dl>
</div>
</div>
<a id="a801aa7a78b2254c31c3ef7e0b24208e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a801aa7a78b2254c31c3ef7e0b24208e3">&#9670;&nbsp;</a></span>Run()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void crashpad::test::Multiprocess::Run </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Runs the test. </p>
<p>This method establishes the proper testing environment by calling <a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#a122d18401346cf600a4f6ab63d83c8ca" title="Establishes the proper testing environment prior to forking.">PreFork()</a>, then calls <code>fork()</code>. In the parent process, it calls RunParent(), and in the child process, it calls RunChild().</p>
<p>This method uses gtest assertions to validate the testing environment. If the testing environment cannot be set up properly, it is possible that MultiprocessParent() or MultiprocessChild() will not be called. In the parent process, this method also waits for the child process to exit after MultiprocessParent() returns, and verifies that it exited in accordance with the expectations set by <a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#a564b4c38239fc991d17c865deaf3c9cf" title="Sets the expected termination reason and code.">SetExpectedChildTermination()</a>. </p>
</div>
</div>
<a id="a564b4c38239fc991d17c865deaf3c9cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a564b4c38239fc991d17c865deaf3c9cf">&#9670;&nbsp;</a></span>SetExpectedChildTermination()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void crashpad::test::Multiprocess::SetExpectedChildTermination </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#adedaaa5fbbb57de1ae5af8ef7c84b4bf">TerminationReason</a>&#160;</td>
<td class="paramname"><em>reason</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ReturnCodeType&#160;</td>
<td class="paramname"><em>code</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the expected termination reason and code. </p>
<p>The default expected termination reason is TerminationReason::kTerminationNormal, and the default expected termination code is <code>EXIT_SUCCESS</code> (<code>0</code>).</p>
<p>This method does not need to be called if the default termination expectation is appropriate, but if this method is called, it must be called before <a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#a801aa7a78b2254c31c3ef7e0b24208e3" title="Runs the test.">Run()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">reason</td><td>Whether to expect the child to terminate normally or as a result of a signal. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">code</td><td>If <em>reason</em> is TerminationReason::kTerminationNormal, this is the expected exit status of the child. If <em>reason</em> is TerminationReason::kTerminationSignal, this is the signal that is expected to kill the child. On Linux platforms, SIG_DFL will be installed for <em>code</em> in the child process. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ab1ecd18814f4be49eedfe1dc076e1500"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab1ecd18814f4be49eedfe1dc076e1500">&#9670;&nbsp;</a></span>WritePipeHandle()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespacecrashpad.html#a07f8e33c4fdeba3783277f9f2563e48a">FileHandle</a> crashpad::test::Multiprocess::WritePipeHandle </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the write pipe’s file handle. </p>
<p>This method may be called by either the parent or the child process. Anything written to this file handle in this process will appear on the read pipe in the partner process.</p>
<p>It is an error to call this after <a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#a9d7a2037501f89d4d8aa3099285b7ae9" title="Closes the write pipe.">CloseWritePipe()</a> has been called.</p>
<dl class="section return"><dt>Returns</dt><dd>The write pipe’s file handle. </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>test/multiprocess.h</li>
<li>test/multiprocess_exec_fuchsia.cc</li>
<li>test/multiprocess_exec_win.cc</li>
<li>test/multiprocess_posix.cc</li>
</ul>
</div><!-- contents -->
<div class="ttc" id="aclasscrashpad_1_1test_1_1Multiprocess_html_a122d18401346cf600a4f6ab63d83c8ca"><div class="ttname"><a href="classcrashpad_1_1test_1_1Multiprocess.html#a122d18401346cf600a4f6ab63d83c8ca">crashpad::test::Multiprocess::PreFork</a></div><div class="ttdeci">virtual void PreFork()</div><div class="ttdoc">Establishes the proper testing environment prior to forking.</div><div class="ttdef"><b>Definition:</b> multiprocess_posix.cc:175</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>