Author: Chelsea Cassanova Date: 2024-02-06T08:36:00-08:00 New Revision: 56900278b578b4f7beedb8ac1e52c541d347f401
URL: https://github.com/llvm/llvm-project/commit/56900278b578b4f7beedb8ac1e52c541d347f401 DIFF: https://github.com/llvm/llvm-project/commit/56900278b578b4f7beedb8ac1e52c541d347f401.diff LOG: [lldb][unittest] Use shared once_flag in DiagnosticEventTest (#80788) Incorporates the changes from https://github.com/llvm/llvm-project/pull/80786 to use a once_flag from `TestUtilities` instead of a local flag in order to prevent hitting an assertion that the debugger was initialized again in another test. Added: Modified: lldb/unittests/Core/DiagnosticEventTest.cpp Removed: ################################################################################ diff --git a/lldb/unittests/Core/DiagnosticEventTest.cpp b/lldb/unittests/Core/DiagnosticEventTest.cpp index bca8f3789955ab..d06f164e87e70c 100644 --- a/lldb/unittests/Core/DiagnosticEventTest.cpp +++ b/lldb/unittests/Core/DiagnosticEventTest.cpp @@ -11,6 +11,7 @@ #include "Plugins/Platform/MacOSX/PlatformMacOSX.h" #include "Plugins/Platform/MacOSX/PlatformRemoteMacOSX.h" #include "TestingSupport/SubsystemRAII.h" +#include "TestingSupport/TestUtilities.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/DebuggerEvents.h" #include "lldb/Host/FileSystem.h" @@ -26,8 +27,6 @@ using namespace lldb_private::repro; static const constexpr std::chrono::seconds TIMEOUT(0); static const constexpr size_t DEBUGGERS = 3; -static std::once_flag debugger_initialize_flag; - namespace { class DiagnosticEventTest : public ::testing::Test { public: @@ -35,7 +34,7 @@ class DiagnosticEventTest : public ::testing::Test { FileSystem::Initialize(); HostInfo::Initialize(); PlatformMacOSX::Initialize(); - std::call_once(debugger_initialize_flag, + std::call_once(TestUtilities::g_debugger_initialize_flag, []() { Debugger::Initialize(nullptr); }); ArchSpec arch("x86_64-apple-macosx-"); Platform::SetHostPlatform( _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits