blob: 905d582c2abde59de29f19086de147e1e2b9c02f [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::MultiprocessExec 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_1MultiprocessExec.html">MultiprocessExec</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classcrashpad_1_1test_1_1MultiprocessExec-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">crashpad::test::MultiprocessExec Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Manages an <code>exec()</code>-based multiprocess test.
<a href="classcrashpad_1_1test_1_1MultiprocessExec.html#details">More...</a></p>
<p><code>#include &quot;test/multiprocess_exec.h&quot;</code></p>
<div class="dynheader">
Inheritance diagram for crashpad::test::MultiprocessExec:</div>
<div class="dyncontent">
<div class="center">
<img src="classcrashpad_1_1test_1_1MultiprocessExec.png" usemap="#crashpad::test::MultiprocessExec_map" alt=""/>
<map id="crashpad::test::MultiprocessExec_map" name="crashpad::test::MultiprocessExec_map">
<area href="classcrashpad_1_1test_1_1Multiprocess.html" title="Manages a multiprocess test." alt="crashpad::test::Multiprocess" shape="rect" coords="0,0,196,24"/>
</map>
</div></div>
<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:ad6ead21552f6326728ecdabede8e59d6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1test_1_1MultiprocessExec.html#ad6ead21552f6326728ecdabede8e59d6">SetChildCommand</a> (const base::FilePath &amp;command, const std::vector&lt; std::string &gt; *arguments)</td></tr>
<tr class="memdesc:ad6ead21552f6326728ecdabede8e59d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the command to <code>exec()</code> in the child. <a href="classcrashpad_1_1test_1_1MultiprocessExec.html#ad6ead21552f6326728ecdabede8e59d6">More...</a><br /></td></tr>
<tr class="separator:ad6ead21552f6326728ecdabede8e59d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad430d38feca0b12506c3de50707f1fdd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1test_1_1MultiprocessExec.html#ad430d38feca0b12506c3de50707f1fdd">SetChildTestMainFunction</a> (const std::string &amp;function_name)</td></tr>
<tr class="memdesc:ad430d38feca0b12506c3de50707f1fdd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calls <a class="el" href="classcrashpad_1_1test_1_1MultiprocessExec.html#ad6ead21552f6326728ecdabede8e59d6" title="Sets the command to exec() in the child.">SetChildCommand()</a> to run a child test main function registered with <a class="el" href="multiprocess__exec_8h.html#a62b5891d00df060b50ee76f74b1156b3" title="Registers a function that can be invoked as a child process by MultiprocessExec.">CRASHPAD_CHILD_TEST_MAIN()</a>. <a href="classcrashpad_1_1test_1_1MultiprocessExec.html#ad430d38feca0b12506c3de50707f1fdd">More...</a><br /></td></tr>
<tr class="separator:ad430d38feca0b12506c3de50707f1fdd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a89bf62a7cef0f35bb814ee07a3351b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacecrashpad_1_1test.html#aaa6abeab378a8e4206ae2e6a34126c48">ProcessType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1test_1_1MultiprocessExec.html#a9a89bf62a7cef0f35bb814ee07a3351b">ChildProcess</a> ()</td></tr>
<tr class="memdesc:a9a89bf62a7cef0f35bb814ee07a3351b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a ProcessType representing the child process. <a href="classcrashpad_1_1test_1_1MultiprocessExec.html#a9a89bf62a7cef0f35bb814ee07a3351b">More...</a><br /></td></tr>
<tr class="separator:a9a89bf62a7cef0f35bb814ee07a3351b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classcrashpad_1_1test_1_1Multiprocess"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classcrashpad_1_1test_1_1Multiprocess')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html">crashpad::test::Multiprocess</a></td></tr>
<tr class="memitem:a801aa7a78b2254c31c3ef7e0b24208e3 inherit pub_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pub_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pub_methods_classcrashpad_1_1test_1_1Multiprocess"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a564b4c38239fc991d17c865deaf3c9cf inherit pub_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pub_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pub_methods_classcrashpad_1_1test_1_1Multiprocess"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc2bc24e4acfa5833936e0b7e97b91c8 inherit pub_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pub_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pub_methods_classcrashpad_1_1test_1_1Multiprocess"><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:a4fbe35bfe7dd75624b417c435ae2208b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1test_1_1MultiprocessExec.html#a4fbe35bfe7dd75624b417c435ae2208b">PreFork</a> () override</td></tr>
<tr class="memdesc:a4fbe35bfe7dd75624b417c435ae2208b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Establishes the proper testing environment prior to forking. <a href="classcrashpad_1_1test_1_1MultiprocessExec.html#a4fbe35bfe7dd75624b417c435ae2208b">More...</a><br /></td></tr>
<tr class="separator:a4fbe35bfe7dd75624b417c435ae2208b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_methods_classcrashpad_1_1test_1_1Multiprocess"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classcrashpad_1_1test_1_1Multiprocess')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html">crashpad::test::Multiprocess</a></td></tr>
<tr class="memitem:abff853ba6c2c4e88c4c759fccc287b94 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a208b33d3006abfd8e024430c510aa117 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1ecd18814f4be49eedfe1dc076e1500 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89ec1079c25eca71250ff3ccf8ec2b72 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d7a2037501f89d4d8aa3099285b7ae9 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af170901b8c26c3c24fc82419df305e1c inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21d17479b00152c3511de0b6d87c8727 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pro_methods_classcrashpad_1_1test_1_1Multiprocess"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_types_classcrashpad_1_1test_1_1Multiprocess"><td colspan="2" onclick="javascript:toggleInherit('pub_types_classcrashpad_1_1test_1_1Multiprocess')"><img src="closed.png" alt="-"/>&#160;Public Types inherited from <a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html">crashpad::test::Multiprocess</a></td></tr>
<tr class="memitem:adedaaa5fbbb57de1ae5af8ef7c84b4bf inherit pub_types_classcrashpad_1_1test_1_1Multiprocess"><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 inherit pub_types_classcrashpad_1_1test_1_1Multiprocess"><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 an <code>exec()</code>-based multiprocess test. </p>
<p>These tests are based on <code>fork()</code> and <code>exec()</code>. The parent process is able to communicate with the child in the same manner as a base-class <a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html" title="Manages a multiprocess test.">Multiprocess</a> parent. The read and write pipes appear in the child process on stdin and stdout, respectively.</p>
<p>Subclasses are expected to implement the parent in the same was as a base-class <a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html" title="Manages a multiprocess test.">Multiprocess</a> parent. The child must be implemented in an executable to be set by <a class="el" href="classcrashpad_1_1test_1_1MultiprocessExec.html#ad6ead21552f6326728ecdabede8e59d6" title="Sets the command to exec() in the child.">SetChildCommand()</a>. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a9a89bf62a7cef0f35bb814ee07a3351b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9a89bf62a7cef0f35bb814ee07a3351b">&#9670;&nbsp;</a></span>ChildProcess()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespacecrashpad_1_1test.html#aaa6abeab378a8e4206ae2e6a34126c48">ProcessType</a> crashpad::test::MultiprocessExec::ChildProcess </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a ProcessType representing the child process. </p>
<p>This method is only valid during the body of MultiprocessParent().</p>
<dl class="section return"><dt>Returns</dt><dd>A platform-specific type representing the child process. This method can fail on macOS because access to a child's task port requires the task_for_pid entitlement. </dd></dl>
</div>
</div>
<a id="a4fbe35bfe7dd75624b417c435ae2208b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4fbe35bfe7dd75624b417c435ae2208b">&#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::MultiprocessExec::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">override</span><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_1MultiprocessExec.html#a4fbe35bfe7dd75624b417c435ae2208b">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 from <a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#a122d18401346cf600a4f6ab63d83c8ca">crashpad::test::Multiprocess</a>.</p>
</div>
</div>
<a id="ad6ead21552f6326728ecdabede8e59d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad6ead21552f6326728ecdabede8e59d6">&#9670;&nbsp;</a></span>SetChildCommand()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void crashpad::test::MultiprocessExec::SetChildCommand </td>
<td>(</td>
<td class="paramtype">const base::FilePath &amp;&#160;</td>
<td class="paramname"><em>command</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; std::string &gt; *&#160;</td>
<td class="paramname"><em>arguments</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the command to <code>exec()</code> in the child. </p>
<p>This method must be called before the test can be <a class="el" href="classcrashpad_1_1test_1_1Multiprocess.html#a801aa7a78b2254c31c3ef7e0b24208e3" title="Runs the test.">Run()</a>.</p>
<p>This method is useful when a custom executable is required for the child binary, however, <a class="el" href="classcrashpad_1_1test_1_1MultiprocessExec.html#ad430d38feca0b12506c3de50707f1fdd" title="Calls SetChildCommand() to run a child test main function registered with CRASHPAD_CHILD_TEST_MAIN().">SetChildTestMainFunction()</a> should generally be preferred.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">command</td><td>The executable’s pathname. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">arguments</td><td>The command-line arguments to pass to the child process in its <code>argv[]</code> vector. This vector must begin at <code>argv[1]</code>, as <em>command</em> is implicitly used as <code>argv[0]</code>. This argument may be <code>nullptr</code> if no command-line arguments are to be passed.</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classcrashpad_1_1test_1_1MultiprocessExec.html#ad430d38feca0b12506c3de50707f1fdd" title="Calls SetChildCommand() to run a child test main function registered with CRASHPAD_CHILD_TEST_MAIN().">SetChildTestMainFunction</a> </dd></dl>
</div>
</div>
<a id="ad430d38feca0b12506c3de50707f1fdd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad430d38feca0b12506c3de50707f1fdd">&#9670;&nbsp;</a></span>SetChildTestMainFunction()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void crashpad::test::MultiprocessExec::SetChildTestMainFunction </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>function_name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Calls <a class="el" href="classcrashpad_1_1test_1_1MultiprocessExec.html#ad6ead21552f6326728ecdabede8e59d6" title="Sets the command to exec() in the child.">SetChildCommand()</a> to run a child test main function registered with <a class="el" href="multiprocess__exec_8h.html#a62b5891d00df060b50ee76f74b1156b3" title="Registers a function that can be invoked as a child process by MultiprocessExec.">CRASHPAD_CHILD_TEST_MAIN()</a>. </p>
<p>This uses the same launch mechanism as <a class="el" href="classcrashpad_1_1test_1_1MultiprocessExec.html#ad6ead21552f6326728ecdabede8e59d6" title="Sets the command to exec() in the child.">SetChildCommand()</a>, but coordinates with test/gtest_main.cc to allow for simple registration of a child processes' entry point via the helper macro, rather than needing to create a separate build target.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">function_name</td><td>The name of the function as passed to <a class="el" href="multiprocess__exec_8h.html#a62b5891d00df060b50ee76f74b1156b3" title="Registers a function that can be invoked as a child process by MultiprocessExec.">CRASHPAD_CHILD_TEST_MAIN()</a>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>test/<a class="el" href="multiprocess__exec_8h.html">multiprocess_exec.h</a></li>
<li>test/multiprocess_exec.cc</li>
<li>test/multiprocess_exec_fuchsia.cc</li>
<li>test/multiprocess_exec_posix.cc</li>
<li>test/multiprocess_exec_win.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>
<div class="ttc" id="aclasscrashpad_1_1test_1_1MultiprocessExec_html_a4fbe35bfe7dd75624b417c435ae2208b"><div class="ttname"><a href="classcrashpad_1_1test_1_1MultiprocessExec.html#a4fbe35bfe7dd75624b417c435ae2208b">crashpad::test::MultiprocessExec::PreFork</a></div><div class="ttdeci">void PreFork() override</div><div class="ttdoc">Establishes the proper testing environment prior to forking.</div><div class="ttdef"><b>Definition:</b> multiprocess_exec_fuchsia.cc:147</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>