Crashpad
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Loading...
Searching...
No Matches
multiprocess_exec.h File Reference
#include <string>
#include <vector>
#include "base/files/file_path.h"
#include "build/build_config.h"
#include "test/multiprocess.h"
#include "test/process_type.h"
Include dependency graph for multiprocess_exec.h:

Classes

class  crashpad::test::internal::AppendMultiprocessTest
 Helper class used by CRASHPAD_CHILD_TEST_MAIN() to insert a child function into the global mapping. More...
 
class  crashpad::test::MultiprocessExec
 Manages an exec()-based multiprocess test. More...
 

Namespaces

namespace  crashpad
 The main namespace.
 
namespace  crashpad::test
 The testing namespace, for use in test code only.
 

Macros

#define CRASHPAD_CHILD_TEST_MAIN(test_main)
 Registers a function that can be invoked as a child process by MultiprocessExec.
 

Functions

int crashpad::test::internal::CheckedInvokeMultiprocessChild (const std::string &test_name)
 Used to run a child test function by name, registered by CRASHPAD_CHILD_TEST_MAIN().
 

Variables

constexpr char crashpad::test::internal::kChildTestFunction [] = "--child-test-function="
 Command line argument used to indicate that a child test function should be run.
 

Macro Definition Documentation

◆ CRASHPAD_CHILD_TEST_MAIN

#define CRASHPAD_CHILD_TEST_MAIN ( test_main)
Value:
int test_main(); \
namespace { \
::crashpad::test::internal::AppendMultiprocessTest \
AddMultiprocessTest##_##test_main(#test_main, (test_main)); \
} /* namespace */ \
int test_main()

Registers a function that can be invoked as a child process by MultiprocessExec.

Used as:

CRASHPAD_CHILD_TEST_MAIN(MyChildTestBody) {
... child body ...
}
#define CRASHPAD_CHILD_TEST_MAIN(test_main)
Registers a function that can be invoked as a child process by MultiprocessExec.
Definition multiprocess_exec.h:69

In the main (parent) test body, this function can be run in a child process via MultiprocessExec::SetChildTestMainFunction().

Function Documentation

◆ CheckedInvokeMultiprocessChild()

int crashpad::test::internal::CheckedInvokeMultiprocessChild ( const std::string & test_name)

Used to run a child test function by name, registered by CRASHPAD_CHILD_TEST_MAIN().

Returns
The exit code of the child process after running the function named by test_name. Aborts with a CHECK() if test_name wasn't registered.