From 7fda640855478abcf68a743f3a7f83097adc9b06 Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Thu, 11 Jul 2013 12:53:47 +0800 Subject: [PATCH v2 3/3] TEST: polish test build detection in libdbus test files Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66753 Signed-off-by: Chengwei Yang --- dbus/dbus-test.c | 14 ++++---------- dbus/dbus-test.h | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/dbus/dbus-test.c b/dbus/dbus-test.c index 1539bce..c81c6dd 100644 --- a/dbus/dbus-test.c +++ b/dbus/dbus-test.c @@ -22,13 +22,15 @@ */ #include + +#ifdef DBUS_ENABLE_EMBEDDED_TESTS + #include "dbus-test.h" #include "dbus-sysdeps.h" #include "dbus-internals.h" #include #include -#ifdef DBUS_ENABLE_EMBEDDED_TESTS static void die (const char *failure) { @@ -84,8 +86,6 @@ run_data_test (const char *test_name, } } -#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ - /** * An exported symbol to be run in order to execute * unit tests. Should not be used by @@ -98,7 +98,6 @@ run_data_test (const char *test_name, void dbus_internal_do_not_use_run_tests (const char *test_data_dir, const char *specific_test) { -#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (!_dbus_threads_init_debug ()) die ("debug threads init"); @@ -134,9 +133,7 @@ dbus_internal_do_not_use_run_tests (const char *test_data_dir, const char *speci run_test ("memory", specific_test, _dbus_memory_test); -#if 1 run_test ("mem-pool", specific_test, _dbus_mem_pool_test); -#endif run_test ("list", specific_test, _dbus_list_test); @@ -165,8 +162,5 @@ dbus_internal_do_not_use_run_tests (const char *test_data_dir, const char *speci run_data_test ("auth", specific_test, _dbus_auth_test, test_data_dir); printf ("%s: completed successfully\n", "dbus-test"); -#else - printf ("Not compiled with unit tests, not running any\n"); -#endif } - +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-test.h b/dbus/dbus-test.h index f254388..28d1725 100644 --- a/dbus/dbus-test.h +++ b/dbus/dbus-test.h @@ -54,7 +54,7 @@ dbus_bool_t _dbus_object_tree_test (void); dbus_bool_t _dbus_credentials_test (const char *test_data_dir); void dbus_internal_do_not_use_run_tests (const char *test_data_dir, - const char *specific_test); + const char *specific_test); dbus_bool_t dbus_internal_do_not_use_try_message_file (const DBusString *filename, DBusValidity expected_validity); dbus_bool_t dbus_internal_do_not_use_try_message_data (const DBusString *data, -- 1.7.9.5