[Lldb-commits] [lldb] [lldb][Telemetry] Fix unit test compile failure with LLVM_ENABLE_TELEMETRY=0 (PR #136115)

Raul Tambre via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 17 02:28:12 PDT 2025


https://github.com/tambry created https://github.com/llvm/llvm-project/pull/136115

It needs to be `TEST_F` to access `received_entries`.
Disabling also works based on the test not the fixture name.

Build failure:
```
lldb/unittests/Core/TelemetryTest.cpp:110:17: error: use of undeclared identifier 'received_entries'
  110 |   ASSERT_EQ(1U, received_entries.size());
      |                 ^
lldb/unittests/Core/TelemetryTest.cpp:112:61: error: use of undeclared identifier 'received_entries'
  112 |             llvm::dyn_cast<lldb_private::FakeTelemetryInfo>(received_entries[0])
      |                                                             ^
```

Fixes: 159b872b37363511a359c800bcc9230bb09f2457

>From 2c93219ad894416e87458bfed2d2745e29b5bbe0 Mon Sep 17 00:00:00 2001
From: Raul Tambre <raul at tambre.ee>
Date: Thu, 17 Apr 2025 12:21:32 +0300
Subject: [PATCH] [lldb][Telemetry] Fix unit test compile failure with
 LLVM_ENABLE_TELEMETRY=0

It needs to be `TEST_F` to access `received_entries`.
Disabling also works based on the test not the fixture name.

Build failure:
```
lldb/unittests/Core/TelemetryTest.cpp:110:17: error: use of undeclared identifier 'received_entries'
  110 |   ASSERT_EQ(1U, received_entries.size());
      |                 ^
lldb/unittests/Core/TelemetryTest.cpp:112:61: error: use of undeclared identifier 'received_entries'
  112 |             llvm::dyn_cast<lldb_private::FakeTelemetryInfo>(received_entries[0])
      |                                                             ^
```

Fixes: 159b872b37363511a359c800bcc9230bb09f2457
---
 lldb/unittests/Core/TelemetryTest.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/unittests/Core/TelemetryTest.cpp b/lldb/unittests/Core/TelemetryTest.cpp
index 1e41424bac3ce..910149d865c13 100644
--- a/lldb/unittests/Core/TelemetryTest.cpp
+++ b/lldb/unittests/Core/TelemetryTest.cpp
@@ -96,7 +96,7 @@ class TelemetryTest : public testing::Test {
 #if LLVM_ENABLE_TELEMETRY
 #define TELEMETRY_TEST(suite, test) TEST_F(suite, test)
 #else
-#define TELEMETRY_TEST(suite, test) TEST(DISABLED_##suite, test)
+#define TELEMETRY_TEST(suite, test) TEST_F(suite, DISABLED_##test)
 #endif
 
 TELEMETRY_TEST(TelemetryTest, PluginTest) {



More information about the lldb-commits mailing list