From 122f4c051db2d1f02569db5b167c0932ae29aa4d Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 21 Dec 2016 07:46:30 +0530 Subject: [PATCH] meson: Add tls-interaction test, and fix giomodule test giomodule test needed symbol visibility pragmas added. This is needed on Windows anyway, so it's better to do it this way rather than disabling -fvisibility=hidden for the test modules. --- gio/tests/meson.build | 8 ++++++++ gio/tests/modules/symbol-visibility.h | 16 ++++++++++++++++ gio/tests/modules/test-module-a.c | 6 ++++-- gio/tests/modules/test-module-b.c | 6 ++++-- 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 gio/tests/modules/symbol-visibility.h diff --git a/gio/tests/meson.build b/gio/tests/meson.build index 1a3cbd917..d82aededa 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -144,6 +144,12 @@ exe = executable('tls-certificate', 'tls-certificate.c', 'gtesttlsbackend.c', ) test('tls-certificate', exe, env : test_env) +exe = executable('tls-interaction', 'tls-interaction.c', 'gtesttlsbackend.c', + c_args : test_c_args, + dependencies : [libglib_dep, libgmodule_dep, libgio_dep], +) +test('tls-interaction', exe, env : test_env) + exe = executable('socket-client', 'socket-client.c', 'gtlsconsoleinteraction.c', c_args : test_c_args, dependencies : [libglib_dep, libgmodule_dep, libgio_dep], @@ -156,6 +162,8 @@ exe = executable('socket-client', 'socket-client.c', 'gtlsconsoleinteraction.c', #) #test('gdbus-daemon', exe, env : test_env) +# FIXME: Add resources test + foo = ''' c_args_atomic = [ ] if cc.get_id() == 'gcc' diff --git a/gio/tests/modules/symbol-visibility.h b/gio/tests/modules/symbol-visibility.h new file mode 100644 index 000000000..f9f8826ce --- /dev/null +++ b/gio/tests/modules/symbol-visibility.h @@ -0,0 +1,16 @@ +#ifndef GLIB_TEST_SYMBOL_VISIBILITY +#define GLIB_TEST_SYMBOL_VISIBILITY + +/* This is the same check that's done in configure to create config.h */ +#ifdef _WIN32 +# ifdef _MSC_VER +# define GLIB_TEST_EXPORT_SYMBOL __declspec(dllexport) extern +# else +# define GLIB_TEST_EXPORT_SYMBOL __attribute__((visibility("default"))) __declspec(dllexport) extern +# endif +/* Matches GCC and Clang */ +#elif defined(__GNUC__) && (__GNUC__ >= 4) +# define GLIB_TEST_EXPORT_SYMBOL __attribute__((visibility("default"))) extern +#endif + +#endif /* GLIB_TEST_SYMBOL_VISIBILITY */ diff --git a/gio/tests/modules/test-module-a.c b/gio/tests/modules/test-module-a.c index ffe7ae31e..0644fdc3a 100644 --- a/gio/tests/modules/test-module-a.c +++ b/gio/tests/modules/test-module-a.c @@ -22,6 +22,8 @@ #include +#include "symbol-visibility.h" + typedef struct _TestA { GObject parent; } TestA; @@ -42,7 +44,7 @@ test_a_init (TestA *self) { } -void +GLIB_TEST_EXPORT_SYMBOL void g_io_module_load (GIOModule *module) { g_io_extension_point_implement ("test-extension-point", @@ -51,7 +53,7 @@ g_io_module_load (GIOModule *module) 30); } -void +GLIB_TEST_EXPORT_SYMBOL void g_io_module_unload (GIOModule *module) { } diff --git a/gio/tests/modules/test-module-b.c b/gio/tests/modules/test-module-b.c index aaf15d696..5ec920887 100644 --- a/gio/tests/modules/test-module-b.c +++ b/gio/tests/modules/test-module-b.c @@ -22,6 +22,8 @@ #include +#include "symbol-visibility.h" + typedef struct _TestB { GObject parent; } TestB; @@ -42,7 +44,7 @@ test_b_init (TestB *self) { } -void +GLIB_TEST_EXPORT_SYMBOL void g_io_module_load (GIOModule *module) { g_io_extension_point_implement ("test-extension-point", @@ -51,7 +53,7 @@ g_io_module_load (GIOModule *module) 40); } -void +GLIB_TEST_EXPORT_SYMBOL void g_io_module_unload (GIOModule *module) { }