Skip to content

Commit 38f07a8

Browse files
committed
[LLDB]Fix test crash
Unregister the fake manager at end of test (#129910)
1 parent 9ad5156 commit 38f07a8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lldb/unittests/Core/TelemetryTest.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "llvm/ADT/StringRef.h"
1212
#include "llvm/Support/Error.h"
1313
#include "llvm/Telemetry/Telemetry.h"
14+
#include "TestingSupport/SubsystemRAII.h"
1415
#include "llvm/Testing/Support/Error.h"
1516
#include "gtest/gtest.h"
1617
#include <memory>
@@ -77,8 +78,13 @@ class FakePlugin : public telemetry::TelemetryManager {
7778

7879
using namespace lldb_private::telemetry;
7980

81+
class TelemetryTest : public testing::Test {
82+
public:
83+
SubsystemRAII<FakePlugin> subsystems;
84+
};
85+
8086
#if LLVM_ENABLE_TELEMETRY
81-
#define TELEMETRY_TEST(suite, test) TEST(suite, test)
87+
#define TELEMETRY_TEST(suite, test) TEST_F(suite, test)
8288
#else
8389
#define TELEMETRY_TEST(suite, test) TEST(DISABLED_##suite, test)
8490
#endif

0 commit comments

Comments
 (0)