diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2019-11-15 16:55:58 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-10-09 09:32:27 +0800 |
commit | a3bd59bf7b2441c4575b0d82c671684df89d5243 (patch) | |
tree | f0d6dd72e28a3b0125b2b247f44fe94cba7d56a9 /tests | |
parent | c34c89ca4ac5b1688e580341e8703fbbdd79dfda (diff) | |
download | libpeas-a3bd59bf7b2441c4575b0d82c671684df89d5243.tar.gz |
tests: Ensure symbols are exported on MSVC builds
Use a macro that is defined appropriately so that we also export the
symbols of the test DLLs on Visual Studio builds as well.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/libpeas-gtk/testing/testing.h | 5 | ||||
-rw-r--r-- | tests/libpeas/introspection/introspection-abstract.h | 7 | ||||
-rw-r--r-- | tests/libpeas/introspection/introspection-base.h | 7 | ||||
-rw-r--r-- | tests/libpeas/introspection/introspection-callable.h | 10 | ||||
-rw-r--r-- | tests/libpeas/introspection/introspection-has-prerequisite.h | 3 | ||||
-rw-r--r-- | tests/libpeas/introspection/introspection-prerequisite.h | 3 | ||||
-rw-r--r-- | tests/libpeas/introspection/introspection-unimplemented.h | 3 | ||||
-rw-r--r-- | tests/libpeas/plugins/embedded/embedded-plugin.h | 3 | ||||
-rw-r--r-- | tests/libpeas/testing/testing-extension.h | 7 | ||||
-rw-r--r-- | tests/libpeas/testing/testing.h | 2 | ||||
-rw-r--r-- | tests/testing-util/peas-test-common.h | 26 | ||||
-rw-r--r-- | tests/testing-util/testing-util.h | 17 |
12 files changed, 93 insertions, 0 deletions
diff --git a/tests/libpeas-gtk/testing/testing.h b/tests/libpeas-gtk/testing/testing.h index d75deed..9126238 100644 --- a/tests/libpeas-gtk/testing/testing.h +++ b/tests/libpeas-gtk/testing/testing.h @@ -28,17 +28,22 @@ G_BEGIN_DECLS +PEAS_TEST_EXPORT void testing_init (gint *argc, gchar ***argv); +PEAS_TEST_EXPORT PeasEngine *testing_engine_new (void); +PEAS_TEST_EXPORT PeasPluginInfo *testing_get_plugin_info_for_iter (PeasGtkPluginManagerView *view, GtkTreeIter *iter); +PEAS_TEST_EXPORT gboolean testing_get_iter_for_plugin_info (PeasGtkPluginManagerView *view, PeasPluginInfo *info, GtkTreeIter *iter); +PEAS_TEST_EXPORT void testing_show_widget (gpointer widget); /* libtesting-util functions which do not need to be overridden */ diff --git a/tests/libpeas/introspection/introspection-abstract.h b/tests/libpeas/introspection/introspection-abstract.h index bfff2c4..2b02c8e 100644 --- a/tests/libpeas/introspection/introspection-abstract.h +++ b/tests/libpeas/introspection/introspection-abstract.h @@ -24,6 +24,8 @@ #include <libpeas/peas.h> +#include "../../testing-util/peas-test-common.h" + G_BEGIN_DECLS /* @@ -49,9 +51,14 @@ struct _IntrospectionAbstractClass { /* * Public methods */ +PEAS_TEST_EXPORT GType introspection_abstract_get_type (void) G_GNUC_CONST; + +PEAS_TEST_EXPORT gint introspection_abstract_get_value (IntrospectionAbstract *abstract); + +PEAS_TEST_EXPORT void introspection_abstract_set_value (IntrospectionAbstract *abstract, gint value); diff --git a/tests/libpeas/introspection/introspection-base.h b/tests/libpeas/introspection/introspection-base.h index 64b052f..06b2ba3 100644 --- a/tests/libpeas/introspection/introspection-base.h +++ b/tests/libpeas/introspection/introspection-base.h @@ -24,6 +24,8 @@ #include <libpeas/peas.h> +#include "../../testing-util/peas-test-common.h" + G_BEGIN_DECLS /* @@ -49,9 +51,14 @@ struct _IntrospectionBaseInterface { /* * Public methods */ +PEAS_TEST_EXPORT GType introspection_base_get_type (void) G_GNUC_CONST; + +PEAS_TEST_EXPORT const PeasPluginInfo *introspection_base_get_plugin_info (IntrospectionBase *base); + +PEAS_TEST_EXPORT GSettings *introspection_base_get_settings (IntrospectionBase *base); G_END_DECLS diff --git a/tests/libpeas/introspection/introspection-callable.h b/tests/libpeas/introspection/introspection-callable.h index 69c0fd0..4f8f525 100644 --- a/tests/libpeas/introspection/introspection-callable.h +++ b/tests/libpeas/introspection/introspection-callable.h @@ -24,6 +24,8 @@ #include <glib-object.h> +#include "../../testing-util/peas-test-common.h" + G_BEGIN_DECLS /* @@ -58,13 +60,21 @@ struct _IntrospectionCallableInterface { /* * Public methods */ +PEAS_TEST_EXPORT GType introspection_callable_get_type (void) G_GNUC_CONST; +PEAS_TEST_EXPORT gchar *introspection_callable_call_with_return (IntrospectionCallable *callable); + +PEAS_TEST_EXPORT void introspection_callable_call_no_args (IntrospectionCallable *callable); + +PEAS_TEST_EXPORT void introspection_callable_call_single_arg (IntrospectionCallable *callable, gboolean *called); + +PEAS_TEST_EXPORT void introspection_callable_call_multi_args (IntrospectionCallable *callable, gint in, gint *out, diff --git a/tests/libpeas/introspection/introspection-has-prerequisite.h b/tests/libpeas/introspection/introspection-has-prerequisite.h index 61e13bf..29d25e4 100644 --- a/tests/libpeas/introspection/introspection-has-prerequisite.h +++ b/tests/libpeas/introspection/introspection-has-prerequisite.h @@ -24,6 +24,8 @@ #include <glib-object.h> +#include "../../testing-util/peas-test-common.h" + G_BEGIN_DECLS /* @@ -45,6 +47,7 @@ struct _IntrospectionHasPrerequisiteInterface { /* * Public methods */ +PEAS_TEST_EXPORT GType introspection_has_prerequisite_get_type (void) G_GNUC_CONST; G_END_DECLS diff --git a/tests/libpeas/introspection/introspection-prerequisite.h b/tests/libpeas/introspection/introspection-prerequisite.h index f600d9f..f9f2c85 100644 --- a/tests/libpeas/introspection/introspection-prerequisite.h +++ b/tests/libpeas/introspection/introspection-prerequisite.h @@ -24,6 +24,8 @@ #include <libpeas/peas.h> +#include "../../testing-util/peas-test-common.h" + G_BEGIN_DECLS /* @@ -49,6 +51,7 @@ struct _IntrospectionPrerequisiteClass { /* * Public methods */ +PEAS_TEST_EXPORT GType introspection_prerequisite_get_type (void) G_GNUC_CONST; G_END_DECLS diff --git a/tests/libpeas/introspection/introspection-unimplemented.h b/tests/libpeas/introspection/introspection-unimplemented.h index 832ab88..f4c6dc8 100644 --- a/tests/libpeas/introspection/introspection-unimplemented.h +++ b/tests/libpeas/introspection/introspection-unimplemented.h @@ -24,6 +24,8 @@ #include <glib-object.h> +#include "../../testing-util/peas-test-common.h" + G_BEGIN_DECLS /* @@ -45,6 +47,7 @@ struct _IntrospectionUnimplementedInterface { /* * Public methods */ +PEAS_TEST_EXPORT GType introspection_unimplemented_get_type (void) G_GNUC_CONST; G_END_DECLS diff --git a/tests/libpeas/plugins/embedded/embedded-plugin.h b/tests/libpeas/plugins/embedded/embedded-plugin.h index b4111e5..122c5a3 100644 --- a/tests/libpeas/plugins/embedded/embedded-plugin.h +++ b/tests/libpeas/plugins/embedded/embedded-plugin.h @@ -24,6 +24,8 @@ #include <libpeas/peas.h> +#include "../../../testing-util/peas-test-common.h" + G_BEGIN_DECLS #define TESTING_TYPE_EMBEDDED_PLUGIN (testing_embedded_plugin_get_type ()) @@ -44,6 +46,7 @@ struct _TestingEmbeddedPluginClass { PeasExtensionBaseClass parent_class; }; +PEAS_TEST_EXPORT GType testing_embedded_plugin_get_type (void) G_GNUC_CONST; G_MODULE_EXPORT void testing_embedded_plugin_register_types (PeasObjectModule *module); diff --git a/tests/libpeas/testing/testing-extension.h b/tests/libpeas/testing/testing-extension.h index 7794620..03f5a84 100644 --- a/tests/libpeas/testing/testing-extension.h +++ b/tests/libpeas/testing/testing-extension.h @@ -28,11 +28,18 @@ G_BEGIN_DECLS +PEAS_TEST_EXPORT void testing_extension_basic (const gchar *loader); + +PEAS_TEST_EXPORT void testing_extension_callable (const gchar *loader); + +PEAS_TEST_EXPORT void testing_extension_add (const gchar *path, GTestDataFunc func); + +PEAS_TEST_EXPORT int testing_extension_run_tests (void); #define testing_extension_all(loader) \ diff --git a/tests/libpeas/testing/testing.h b/tests/libpeas/testing/testing.h index d71fdbe..cdc9fdd 100644 --- a/tests/libpeas/testing/testing.h +++ b/tests/libpeas/testing/testing.h @@ -27,9 +27,11 @@ G_BEGIN_DECLS +PEAS_TEST_EXPORT void testing_init (gint *argc, gchar ***argv); +PEAS_TEST_EXPORT PeasEngine *testing_engine_new_full (gboolean nonglobal_loaders); #define testing_engine_new() (testing_engine_new_full (FALSE)) diff --git a/tests/testing-util/peas-test-common.h b/tests/testing-util/peas-test-common.h new file mode 100644 index 0000000..20281ee --- /dev/null +++ b/tests/testing-util/peas-test-common.h @@ -0,0 +1,26 @@ +/*
+ * peas-test-common.h
+ * This file is part of libpeas
+ *
+ * Copyright (C) 2019 - Chun-wei Fan
+ *
+ * libpeas is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * libpeas is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifdef _MSC_VER
+# define PEAS_TEST_EXPORT __declspec (dllexport)
+#else
+# define PEAS_TEST_EXPORT
+#endif
\ No newline at end of file diff --git a/tests/testing-util/testing-util.h b/tests/testing-util/testing-util.h index 0986d5a..27caf9d 100644 --- a/tests/testing-util/testing-util.h +++ b/tests/testing-util/testing-util.h @@ -24,18 +24,35 @@ #include <libpeas/peas-engine.h> +#include "peas-test-common.h" + G_BEGIN_DECLS +PEAS_TEST_EXPORT void testing_util_envars (void); + +PEAS_TEST_EXPORT void testing_util_init (void); + +PEAS_TEST_EXPORT PeasEngine *testing_util_engine_new_full (gboolean nonglobal_loaders); + +PEAS_TEST_EXPORT void testing_util_engine_free (PeasEngine *engine); + +PEAS_TEST_EXPORT int testing_util_run_tests (void); + +PEAS_TEST_EXPORT void testing_util_push_log_hook (const gchar *pattern); + +PEAS_TEST_EXPORT void testing_util_pop_log_hook (void); + +PEAS_TEST_EXPORT void testing_util_pop_log_hooks (void); |