diff options
author | Richard Hughes <richard@hughsie.com> | 2014-10-31 16:40:59 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-10-31 16:41:16 +0000 |
commit | f9c620c1e9e17a80e930091077ef6c89872beec7 (patch) | |
tree | ee9418776826719f24f2b460e1f0dc61abf9ba3a | |
parent | 2a2436de04cc3cd1ae6144785ed089449d2f5f29 (diff) | |
download | appstream-glib-f9c620c1e9e17a80e930091077ef6c89872beec7.tar.gz |
trivial: Fix the libappstream-glib tests when running in a chroot
We can't rely on the fact that there are installed desktop files.
-rw-r--r-- | data/tests/Makefile.am | 1 | ||||
-rw-r--r-- | data/tests/usr/share/applications/test.desktop | 9 | ||||
-rw-r--r-- | libappstream-glib/as-self-test.c | 3 |
3 files changed, 13 insertions, 0 deletions
diff --git a/data/tests/Makefile.am b/data/tests/Makefile.am index 9e2546a..839821f 100644 --- a/data/tests/Makefile.am +++ b/data/tests/Makefile.am @@ -33,6 +33,7 @@ test_files = \ usr/share/app-install/desktop/test.desktop \ usr/share/app-install/icons/aequorea/iceweasel.png \ usr/share/app-install/icons/test.png \ + usr/share/applications/test.desktop \ usr/share/icons/hicolor/64x64/apps/test2.png \ usr/share/icons/hicolor/128x128/apps/test3.png \ usr/share/pixmaps/test.png \ diff --git a/data/tests/usr/share/applications/test.desktop b/data/tests/usr/share/applications/test.desktop new file mode 100644 index 0000000..6eb32b8 --- /dev/null +++ b/data/tests/usr/share/applications/test.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Color Profile Viewer +Comment=Inspect and compare installed color profiles +Icon=audio-input-microphone.svg +Exec=gcm-viewer +Terminal=false +Type=Application +Categories=System; +StartupNotify=true diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c index 2acb78e..162733f 100644 --- a/libappstream-glib/as-self-test.c +++ b/libappstream-glib/as-self-test.c @@ -2469,12 +2469,15 @@ as_test_store_speed_desktop_func (void) gboolean ret; guint i; guint loops = 10; + _cleanup_free_ gchar *filename = NULL; _cleanup_timer_destroy_ GTimer *timer = NULL; + filename = as_test_get_filename ("."); timer = g_timer_new (); for (i = 0; i < loops; i++) { _cleanup_object_unref_ AsStore *store; store = as_store_new (); + as_store_set_destdir (store, filename); ret = as_store_load (store, AS_STORE_LOAD_FLAG_DESKTOP, NULL, &error); g_assert_no_error (error); g_assert (ret); |