summaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2022-03-02 13:17:10 +0100
committerRalf Habacker <ralf.habacker@freenet.de>2022-05-01 19:52:48 +0200
commit5f1bc83d36ab228f8d1cabb87379cf405545c62a (patch)
tree27360e703cac672780ae76fe7b64c860ef1adf08 /test/CMakeLists.txt
parent72a7758e38be9b7b373155e39ee72b5ab1db9567 (diff)
downloaddbus-5f1bc83d36ab228f8d1cabb87379cf405545c62a.tar.gz
Add unit tests for platform-specific mutex implementation.
The tests are enabled with the embedded tests; the required low-level functions from the dbus library are decorated with DBUS_EMBEDDED_TESTS_EXPORT to indicate the appropriate usage. On Windows, all tests are run; on unix-like operating systems, individual tests are disabled: - the tests on #NULL pointers of type DBus[C|R]Mutex, since they point to a data structure and would cause a segment violation when accessed. - the multiple lock test for type DBusCMutex, since it would block the current thread. Since the whole point of "rmutex" is to be able to lock multiple times, the "rmutex double lock" test is enabled on unix-like operating systems too. Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 4689c78b..864d078b 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -144,6 +144,8 @@ if(DBUS_ENABLE_EMBEDDED_TESTS)
add_test_executable(test-misc-internals "${SOURCES}" dbus-testutils)
set_target_properties(test-misc-internals PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
+ add_test_executable(test-platform-mutex test-platform-mutex.c ${DBUS_INTERNAL_LIBRARIES} dbus-testutils)
+
set(SOURCES bus/main.c)
add_test_executable(test-bus "${SOURCES}" dbus-daemon-internal dbus-testutils ${EXPAT_LIBRARIES})
set_target_properties(test-bus PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})