summaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2019-12-12 09:34:58 +0100
committerRalf Habacker <ralf.habacker@freenet.de>2019-12-13 16:13:53 +0100
commite4feb9600e16aebe06539360aa38a2248d4029ba (patch)
tree5884016c7c0115fb0521fc17d0274f3cc1fdc107 /test/CMakeLists.txt
parentbf20f7387381d1bba0a261f6f0a849c0df5d7e1a (diff)
downloaddbus-e4feb9600e16aebe06539360aa38a2248d4029ba.tar.gz
Add a trivial sanity-check for the atomic primitives
This doesn't verify that they're atomic, but does verify that they return the right things. This commit adds a new test function _dbus_test_check (a) to make writing tests easier. It checks the given boolean expression and generates a "not ok" test result if the expression is false. Due to the current design of the test api, the test is only compiled if embedded tests were enabled at the time of configuration. It was also necessary to move the test_atomic target definitions in test/Makefile.am to the --enable-embedded-tests section to avoid a make distcheck build error. The test case itself has been authored by smcv. Co-authored-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 08e7a8b0..d0cc8d4d 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -39,6 +39,10 @@ set(test-shell_SOURCES
shell-test.c
)
+set(test-atomic_SOURCES
+ internals/atomic.c
+)
+
set(test-spawn_SOURCES
spawn-test.c
)
@@ -92,6 +96,7 @@ if(WIN32)
endif()
if(DBUS_ENABLE_EMBEDDED_TESTS)
+ add_test_executable(test-atomic ${test-atomic_SOURCES} dbus-testutils)
add_test_executable(test-hash internals/hash.c dbus-testutils)
set_target_properties(test-hash PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})