summaryrefslogtreecommitdiff
path: root/absl/flags/reflection_test.cc
diff options
context:
space:
mode:
authorGravatar Gennadiy Rozental <rogeeff@google.com>2024-02-02 14:12:56 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2024-02-02 14:14:51 -0800
commit52a711fc8021b49c869581cb5dfea93580502e2c (patch)
tree7130bab50dcccb3a9b4080ec4f37085ff1ef2202 /absl/flags/reflection_test.cc
parent146169f9ad357635b9cd988f976b38bcf83476e3 (diff)
Avoid static initializers in case of ABSL_FLAGS_STRIP_NAMES=1
PiperOrigin-RevId: 603784442 Change-Id: I3d57e5f438b276c984f5d5416889b19e7ddb501a
Diffstat (limited to 'absl/flags/reflection_test.cc')
-rw-r--r--absl/flags/reflection_test.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/absl/flags/reflection_test.cc b/absl/flags/reflection_test.cc
index 79cfa90c..68abeda4 100644
--- a/absl/flags/reflection_test.cc
+++ b/absl/flags/reflection_test.cc
@@ -20,10 +20,8 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
-#include "absl/flags/declare.h"
+#include "absl/flags/config.h"
#include "absl/flags/flag.h"
-#include "absl/flags/internal/commandlineflag.h"
-#include "absl/flags/marshalling.h"
#include "absl/memory/memory.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_split.h"
@@ -36,7 +34,12 @@ namespace {
class ReflectionTest : public testing::Test {
protected:
- void SetUp() override { flag_saver_ = absl::make_unique<absl::FlagSaver>(); }
+ void SetUp() override {
+#if ABSL_FLAGS_STRIP_NAMES
+ GTEST_SKIP() << "This test requires flag names to be present";
+#endif
+ flag_saver_ = absl::make_unique<absl::FlagSaver>();
+ }
void TearDown() override { flag_saver_.reset(); }
private: