about summary refs log tree commit diff
path: root/absl/base
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2020-02-05T22·38-0800
committerAndy Getz <durandal@google.com>2020-02-05T22·48-0500
commit72382c21fefed981b4b8a2a1b82e2d231c2c2e39 (patch)
treec72b06c47adc9f4357335af5a64b75e99361c6ca /absl/base
parent08a7e7bf972c8451855a5022f2faf3d3655db015 (diff)
Export of internal Abseil changes
--
dea3e4f33f16bdb1d89cad1f8055b81c0c0cb554 by Andy Getzendanner <durandal@google.com>:

Validate in log_severity_test that flags of type absl::LogSeverity are lock-free.

PiperOrigin-RevId: 293454285

--
2a0cd2d8dc193a0cbff4ffa6c5c7037745507419 by Derek Mauro <dmauro@google.com>:

Update the testing instructions in CONTRIBUTING.md

PiperOrigin-RevId: 293436013

--
cec91c3f635b0b4c8a60955e5926dba4ed980898 by Gennadiy Rozental <rogeeff@google.com>:

Introduce struct to represent storage for flag value and normalize naming of internal structs in Flag implementation.

There is no semantic changes in this CL. All the internal structs are now named as Flag... We also stop using flags_internal:: qualifications for most of them since the names are unique enough by themselves.

PiperOrigin-RevId: 293251467
GitOrigin-RevId: dea3e4f33f16bdb1d89cad1f8055b81c0c0cb554
Change-Id: I161aecc9509edae3e4b77eead02df684b2ce7087
Diffstat (limited to 'absl/base')
-rw-r--r--absl/base/BUILD.bazel1
-rw-r--r--absl/base/CMakeLists.txt1
-rw-r--r--absl/base/log_severity_test.cc5
3 files changed, 7 insertions, 0 deletions
diff --git a/absl/base/BUILD.bazel b/absl/base/BUILD.bazel
index 9814e4200af4..c6948a272f35 100644
--- a/absl/base/BUILD.bazel
+++ b/absl/base/BUILD.bazel
@@ -675,6 +675,7 @@ cc_test(
     linkopts = ABSL_DEFAULT_LINKOPTS,
     deps = [
         ":log_severity",
+        "//absl/flags:flag_internal",
         "//absl/flags:marshalling",
         "//absl/strings",
         "@com_google_googletest//:gtest_main",
diff --git a/absl/base/CMakeLists.txt b/absl/base/CMakeLists.txt
index 3ca985a910cc..c21571be9b8c 100644
--- a/absl/base/CMakeLists.txt
+++ b/absl/base/CMakeLists.txt
@@ -610,6 +610,7 @@ absl_cc_test(
   SRCS
     "log_severity_test.cc"
   DEPS
+    absl::flags_internal
     absl::flags_marshalling
     absl::log_severity
     absl::strings
diff --git a/absl/base/log_severity_test.cc b/absl/base/log_severity_test.cc
index 1e3aafa56619..2302aa12086a 100644
--- a/absl/base/log_severity_test.cc
+++ b/absl/base/log_severity_test.cc
@@ -24,6 +24,7 @@
 
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
+#include "absl/flags/internal/flag.h"
 #include "absl/flags/marshalling.h"
 #include "absl/strings/str_cat.h"
 
@@ -51,6 +52,10 @@ TEST(StreamTest, Works) {
               Eq("absl::LogSeverity(4)"));
 }
 
+static_assert(
+    absl::flags_internal::IsAtomicFlagTypeTrait<absl::LogSeverity>::value,
+    "Flags of type absl::LogSeverity ought to be lock-free.");
+
 using ParseFlagFromOutOfRangeIntegerTest = TestWithParam<int64_t>;
 INSTANTIATE_TEST_SUITE_P(
     Instantiation, ParseFlagFromOutOfRangeIntegerTest,