summaryrefslogtreecommitdiff
path: root/absl/synchronization/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Derek Mauro <dmauro@google.com>2023-03-20 14:10:11 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-03-20 14:11:09 -0700
commit396e9764cded739f595ba880b95b061051c49128 (patch)
tree02b550c2a2b9a4fcacb4cf2555d9d8672d53248b /absl/synchronization/CMakeLists.txt
parente5067964adcb792b7c9dbddbdcfe4d9b94079597 (diff)
Synchronization: Refactor Waiter to allow us to write tests
Instead of being only able to test the platform Waiter implementation, this allows us to be able to test all Waiter implementations that build on a specific platform. A unittest is added that tests all implementations that work for the platform, and allows us to check that the expected one is being used by printing the name of the selected implementation. PiperOrigin-RevId: 518072415 Change-Id: Ie9e6fcd9d8283b4038e6f4e68a304d2adcc04b19
Diffstat (limited to 'absl/synchronization/CMakeLists.txt')
-rw-r--r--absl/synchronization/CMakeLists.txt26
1 files changed, 25 insertions, 1 deletions
diff --git a/absl/synchronization/CMakeLists.txt b/absl/synchronization/CMakeLists.txt
index 5eb9b566..d95e327f 100644
--- a/absl/synchronization/CMakeLists.txt
+++ b/absl/synchronization/CMakeLists.txt
@@ -71,16 +71,25 @@ absl_cc_library(
"blocking_counter.h"
"internal/create_thread_identity.h"
"internal/futex.h"
+ "internal/futex_waiter.h"
"internal/per_thread_sem.h"
+ "internal/pthread_waiter.h"
+ "internal/sem_waiter.h"
"internal/waiter.h"
+ "internal/waiter_base.h"
+ "internal/win32_waiter.h"
"mutex.h"
"notification.h"
SRCS
"barrier.cc"
"blocking_counter.cc"
"internal/create_thread_identity.cc"
+ "internal/futex_waiter.cc"
"internal/per_thread_sem.cc"
- "internal/waiter.cc"
+ "internal/pthread_waiter.cc"
+ "internal/sem_waiter.cc"
+ "internal/waiter_base.cc"
+ "internal/win32_waiter.cc"
"notification.cc"
"mutex.cc"
COPTS
@@ -239,6 +248,21 @@ absl_cc_test(
absl_cc_test(
NAME
+ waiter_test
+ SRCS
+ "internal/waiter_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::kernel_timeout_internal
+ absl::synchronization
+ absl::thread_pool
+ absl::time
+ GTest::gmock_main
+)
+
+absl_cc_test(
+ NAME
lifetime_test
SRCS
"lifetime_test.cc"