class LdLoadZirconLdsvcTestsBase
Defined at line 30 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.h
This is the common base class for test fixtures that use a
fuchsia.ldsvc.Loader service and set expectations for the dependencies
loaded by it. This class proxies calls to the MockLoaderServiceForTest and
passes the function it should use to retrieve test VMO files.
It takes calls giving ordered expectations for Loader service requests from
the process under test. These must be used after Load() and before Run()
in test cases.
Public Methods
std::string FindInterp (zx::unowned_vmo vmo)
Defined at line 18 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.cc
void ~LdLoadZirconLdsvcTestsBase ()
Defined at line 32 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.h
void LdsvcExpectConfig (std::optional<std::string_view> config)
Optionally expect the dynamic linker to send a Config(config) message.
Defined at line 35 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.h
void LdsvcExpectDependency (std::string_view name)
Prime the MockLoaderService with the VMO for a dependency by name,
and expect the MockLoader to load that dependency for the test.
Defined at line 43 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.h
zx::channel TakeLdsvc ()
Defined at line 45 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.h
zx::vmo GetLibVmo (std::string_view name)
Defined at line 47 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.h
void VerifyAndClearNeeded ()
Defined at line 51 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.h
void LdsvcPathPrefix (std::string_view executable, std::optional<std::string_view> libprefix)
Defined at line 89 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.cc
std::optional<std::string> ConfigFromInterp (const std::filesystem::path & interp, std::optional<std::string_view> expected_config)
Use the PT_INTERP string to update LdsvcPathPrefix() and then return the
config found, which can be passed to LdsvcExpectConfig(). The optional
argument makes it a failure if the extract Config() string doesn't match,
and doesn't change LdsvcPathPrefix().
Defined at line 22 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.cc
zx::vmo GetExecutableVmoWithInterpConfig (std::string_view executable, std::optional<std::string_view> expected_config)
This just combines GetExecutableVmo, FindInterp, ConfigFromInterp, and
LdsvcExpectConfig.
Defined at line 34 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.cc
std::optional<std::string> ConfigFromInterp (zx::unowned_vmo executable_vmo, std::optional<std::string_view> expected_config)
The same, but extract the PT_INTERP string from the executable file VMO.
Defined at line 65 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.h
void NeededViaLoadSet (elfldltl::Soname<> set_name, std::initializer_list<std::string_view> names)
Uses to TestElfLoadSet::Get(test_name) to do Needed() within the test's
package namespace based on the libprefix found in the TestElfObject data
rather than a PT_INTERP in the file.
Defined at line 73 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.cc
Protected Methods
zx::vmo GetInterp (std::string_view executable_name, std::optional<std::string_view> expected_config)
Defined at line 43 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.cc
void LdsvcExpectNeeded ()
Defined at line 85 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.h
MockLoaderServiceForTest & mock ()
Defined at line 95 of file ../../sdk/lib/ld/test/ld-load-zircon-ldsvc-tests-base.h