class LdLoadZirconProcessTestsBase

Defined at line 22 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.h

This is the common base class for test fixtures to launch a Zircon process.

Public Members

static optional kTestExecutableNeedsVdso
static const int64_t kRunFailureForTrap
static const int64_t kRunFailureForBadPointer

Public Methods

void ~LdLoadZirconProcessTestsBase ()

Defined at line 198 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.cc

const char * process_name ()

Defined at line 16 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.cc

int64_t Run ()

This just folds together Start() and Wait(), below.

Defined at line 184 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.cc

std::pair<int64_t, zx::channel> RunWithCustomBootstrap ()

Like Run(), but tells Start() not to send the standard "main" bootstrap

message (only, possibly, the startup dynamic linker message). Instead the

sender side of the bootstrap channel is returned.

Defined at line 189 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.cc

void NeverStart ()

This drops references that won't be used if neither Start() nor Run() is

ever called.

Defined at line 137 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.cc

void CheckVmar ()

Assert that root_vmar() is valid and not destroyed.

Defined at line 218 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.cc

void CheckProcess ()

Assert that the process is valid and not terminated.

Defined at line 204 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.cc

void LegacyAddressSpaceReservation ()

Defined at line 158 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.cc

void RedirectFd (int target_number, fbl::unique_fd transfer_fd)

Use transfer_fd as the child's target_number fd in the main (libc)

bootstrap message. STDERR_FILENO is already implicitly redirected to

process_log_fd() before this is applied.

Defined at line 225 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.cc

Protected Methods

const zx::process & process ()

Defined at line 63 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.h

const zx::vmar & root_vmar ()

These are set by CreateProcess() and used by Start() and Run().

Defined at line 72 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.h

const zx::thread & thread ()

Defined at line 73 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.h

fbl::unique_fd & process_log_fd ()

This is set by CreateProcess() and ultimately consumed by Start(false),

but left intact by Start(true).

Defined at line 77 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.h

TestProcessArgs & bootstrap ()

This is used by Start() and Run(). If it's not empty() when they're

called, its pending startup dynamic linker message gets packed and sent.

Defined at line 81 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.h

uintptr_t entry ()

These are used by Start() and Run(). The subclass must set them first.

Defined at line 84 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.h

uintptr_t vdso_base ()

Defined at line 85 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.h

std::optional<size_t> stack_size ()

Defined at line 86 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.h

void set_entry (uintptr_t entry)

Defined at line 87 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.h

void set_vdso_base (uintptr_t vdso_base)

Defined at line 88 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.h

void set_stack_size (std::optional<size_t> stack_size)

Defined at line 89 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.h

void set_process (zx::process process)

A subclass calls this when not using CreateProcess().

Defined at line 20 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.cc

void CreateProcess ()

A subclass calls CreateProcess() to set process(), root_vmar(), and thread().

Defined at line 25 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.cc

zx::channel Start (bool custom_bootstrap)

Start the process() using all those parameters. If bootstrap() has a

pending message being built, that's completed and sent as the startup

dynamic linker's message. Then, if custom_bootstrap is false, a standard

"main" (libc) message is sent. Finally, the sender side of the bootstrap

channel is returned in case the test wants to either send its own messages

or read replies from the test module.

Defined at line 68 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.cc

int64_t Wait ()

Wait for the process to die and collect its exit code.

This clears the process() so a new one can be installed.

Defined at line 41 of file ../../sdk/lib/ld/test/ld-load-zircon-process-tests-base.cc