diff options
author | Simon McVittie <smcv@collabora.com> | 2020-04-16 14:18:49 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2020-04-20 10:13:07 +0100 |
commit | c383f151be876461a5bfc4d307a2a76c78bcc5cd (patch) | |
tree | 16e429873a50f299de8e632bbfcc065daf69b1a3 /test/internals | |
parent | fcbb5e658604a9501fe408aa8d2a7a753032f992 (diff) | |
download | dbus-c383f151be876461a5bfc4d307a2a76c78bcc5cd.tar.gz |
test: Enable more tests when embedded tests are disabled
These previously relied on embedding test-specific code in libdbus,
but they actually only need public APIs, private interfaces that get
exported anyway for the benefit of dbus-daemon, and the TAP helpers;
so we can run them even in production builds.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'test/internals')
-rw-r--r-- | test/internals/misc-internals.c | 25 | ||||
-rw-r--r-- | test/internals/sha.c | 4 |
2 files changed, 20 insertions, 9 deletions
diff --git a/test/internals/misc-internals.c b/test/internals/misc-internals.c index 5f290a59..3f66b8e3 100644 --- a/test/internals/misc-internals.c +++ b/test/internals/misc-internals.c @@ -895,6 +895,7 @@ _dbus_signature_test (const char *test_data_dir _DBUS_GNUC_UNUSED) } #ifdef DBUS_UNIX +#ifdef DBUS_ENABLE_EMBEDDED_TESTS static dbus_bool_t _dbus_transport_unix_test (const char *test_data_dir _DBUS_GNUC_UNUSED) { @@ -919,6 +920,7 @@ _dbus_transport_unix_test (const char *test_data_dir _DBUS_GNUC_UNUSED) return ret; } +#endif /** * Unit test for dbus-userdb.c. @@ -972,29 +974,34 @@ _dbus_userdb_test (const char *test_data_dir) static DBusTestCase tests[] = { - { "string", _dbus_string_test }, - { "sysdeps", _dbus_sysdeps_test }, - { "data-slot", _dbus_data_slot_test }, { "misc", _dbus_misc_test }, { "address", _dbus_address_test }, { "server", _dbus_server_test }, - { "object-tree", _dbus_object_tree_test }, { "signature", _dbus_signature_test }, - { "marshalling", _dbus_marshal_test }, - { "byteswap", _dbus_marshal_byteswap_test }, - { "memory", _dbus_memory_test }, { "mem-pool", _dbus_mem_pool_test }, { "list", _dbus_list_test }, - { "marshal-validate", _dbus_marshal_validate_test }, + +#ifdef DBUS_ENABLE_EMBEDDED_TESTS + { "auth", _dbus_auth_test }, + { "byteswap", _dbus_marshal_byteswap_test }, { "credentials", _dbus_credentials_test }, + { "data-slot", _dbus_data_slot_test }, { "keyring", _dbus_keyring_test }, + { "marshal-validate", _dbus_marshal_validate_test }, + { "marshalling", _dbus_marshal_test }, + { "memory", _dbus_memory_test }, + { "object-tree", _dbus_object_tree_test }, { "sha", _dbus_sha_test }, - { "auth", _dbus_auth_test }, + { "string", _dbus_string_test }, + { "sysdeps", _dbus_sysdeps_test }, +#endif #if defined(DBUS_UNIX) { "userdb", _dbus_userdb_test }, +#ifdef DBUS_ENABLE_EMBEDDED_TESTS { "transport-unix", _dbus_transport_unix_test }, #endif +#endif { NULL } }; diff --git a/test/internals/sha.c b/test/internals/sha.c index b6f93caa..8de77efb 100644 --- a/test/internals/sha.c +++ b/test/internals/sha.c @@ -26,6 +26,8 @@ #include <config.h> #include "misc-internals.h" +#ifdef DBUS_ENABLE_EMBEDDED_TESTS + #include <stdio.h> #include <string.h> @@ -489,3 +491,5 @@ _dbus_sha_test (const char *test_data_dir) return TRUE; } + +#endif |