[Lldb-commits] [lldb] [lldb][AIX] get host info for AIX (cont..) (PR #138687)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Tue May 27 07:43:00 PDT 2025
================
@@ -90,6 +92,30 @@ TEST(Host, LaunchProcessSetsArgv0) {
ASSERT_THAT(exit_status.get_future().get(), 0);
}
+TEST(Host, FindProcesses) {
+ SubsystemRAII<FileSystem, HostInfo> subsystems;
+
+ if (test_arg != 0)
+ exit(0);
+
+ ProcessLaunchInfo info;
+ ProcessInstanceInfoList processes;
+ ProcessInstanceInfoMatch match(TestMainArgv0, NameMatch::Equals);
+ info.SetExecutableFile(FileSpec(TestMainArgv0),
+ /*add_exe_file_as_first_arg=*/true);
+ info.GetArguments().AppendArgument("--gtest_filter=Host.FindProcesses");
+ info.GetArguments().AppendArgument("--test-arg=48");
+ std::promise<int> exit_status;
+ info.SetMonitorProcessCallback([&](lldb::pid_t pid, int signal, int status) {
+ exit_status.set_value(status);
+ });
+ ASSERT_THAT_ERROR(Host::LaunchProcess(info).takeError(), Succeeded());
+ std::this_thread::sleep_for(std::chrono::milliseconds(1000));
----------------
labath wrote:
```suggestion
auto clean_up = llvm::make_scope_exit([&]{
Host::Kill(info.GetProcessID(), SIGKILL);
exit_status_get_future().get();
});
```
https://github.com/llvm/llvm-project/pull/138687
More information about the lldb-commits
mailing list