[Lldb-commits] [lldb] [lldb/Test] Fix oversight in ProcessEventDataTest::SetUp (NFC) (PR #83895)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 4 11:24:44 PST 2024


https://github.com/medismailben created https://github.com/llvm/llvm-project/pull/83895

This patch addresses an oversight in `ProcessEventDataTest::SetUp` unittest to ensure the Debugger is initialized properly.

>From 1ed521f9de503fd48834a250fb2f071c2d86b1c9 Mon Sep 17 00:00:00 2001
From: Med Ismail Bennani <ismail at bennani.ma>
Date: Mon, 4 Mar 2024 11:00:15 -0800
Subject: [PATCH] [lldb/Test] Fix oversight in ProcessEventDataTest::SetUp
 (NFC)

This patch addresses an oversight in `ProcessEventDataTest::SetUp`
unittest to ensure the Debugger is initialized properly.

Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
---
 lldb/unittests/Process/ProcessEventDataTest.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lldb/unittests/Process/ProcessEventDataTest.cpp b/lldb/unittests/Process/ProcessEventDataTest.cpp
index dd159496cd881d..9905e036a138e8 100644
--- a/lldb/unittests/Process/ProcessEventDataTest.cpp
+++ b/lldb/unittests/Process/ProcessEventDataTest.cpp
@@ -16,6 +16,7 @@
 #include "lldb/Target/Thread.h"
 #include "lldb/Utility/ArchSpec.h"
 #include "lldb/Utility/Event.h"
+#include "TestingSupport/TestUtilities.h"
 #include "gtest/gtest.h"
 
 using namespace lldb_private;
@@ -29,6 +30,8 @@ class ProcessEventDataTest : public ::testing::Test {
     FileSystem::Initialize();
     HostInfo::Initialize();
     PlatformMacOSX::Initialize();
+    std::call_once(TestUtilities::g_debugger_initialize_flag,
+                []() { Debugger::Initialize(nullptr); });
   }
   void TearDown() override {
     PlatformMacOSX::Terminate();



More information about the lldb-commits mailing list