[gnome-software] trivial: Allow setting the AsStore icon root in self tests
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Allow setting the AsStore icon root in self tests
- Date: Tue, 17 May 2016 11:08:56 +0000 (UTC)
commit ca7b06e939b130e776a6a529242b7274a0166f46
Author: Richard Hughes <richard hughsie com>
Date: Tue May 17 12:02:22 2016 +0100
trivial: Allow setting the AsStore icon root in self tests
src/plugins/gs-plugin-appstream.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 1938490..c8241c8 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -148,7 +148,8 @@ gs_plugin_setup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
GPtrArray *items;
gboolean ret;
const gchar *origin;
- const gchar *tmp;
+ const gchar *test_xml;
+ const gchar *test_icon_root;
guint *perc;
guint i;
g_autoptr(GHashTable) origins = NULL;
@@ -160,10 +161,12 @@ gs_plugin_setup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
}
/* only when in self test */
- tmp = g_getenv ("GS_SELF_TEST_APPSTREAM_XML");
- if (tmp != NULL) {
- g_debug ("using self test data of %s", tmp);
- if (!as_store_from_xml (priv->store, tmp, NULL, error))
+ test_xml = g_getenv ("GS_SELF_TEST_APPSTREAM_XML");
+ if (test_xml != NULL) {
+ test_icon_root = g_getenv ("GS_SELF_TEST_APPSTREAM_ICON_ROOT");
+ g_debug ("using self test data of %s... with icon root %s",
+ test_xml, test_icon_root);
+ if (!as_store_from_xml (priv->store, test_xml, test_icon_root, error))
return FALSE;
} else {
ret = as_store_load (priv->store,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]