| 253 | } |
| 254 | |
| 255 | ScopedModuleHandle LoadTestModule(const std::string& module_name, |
| 256 | const std::string& module_soname) { |
| 257 | base::FilePath module_path( |
| 258 | TestPaths::Executable().DirName().Append(module_name)); |
| 259 | |
| 260 | if (!WriteTestModule(module_path, module_soname)) { |
| 261 | return ScopedModuleHandle(nullptr); |
| 262 | } |
| 263 | EXPECT_TRUE(IsRegularFile(module_path)); |
| 264 | |
| 265 | ScopedModuleHandle handle( |
| 266 | dlopen(module_path.value().c_str(), RTLD_LAZY | RTLD_LOCAL)); |
| 267 | EXPECT_TRUE(handle.valid()) |
| 268 | << "dlopen: " << module_path.value() << " " << dlerror(); |
| 269 | |
| 270 | EXPECT_TRUE(LoggingRemoveFile(module_path)); |
| 271 | |
| 272 | return handle; |
| 273 | } |
| 274 | |
| 275 | } // namespace test |
| 276 | } // namespace crashpad |
no test coverage detected