[glib] tests: Fix desktop-app-info test
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] tests: Fix desktop-app-info test
- Date: Tue, 24 Apr 2018 16:45:18 +0000 (UTC)
commit 634355560551bf56d8394899bd6f9c2321fd0142
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Apr 24 15:21:06 2018 +0200
tests: Fix desktop-app-info test
g_desktop_app_info_load_from_keyfile() refuses to load .desktop files
where the executable doesn't exist. Therefore whether or not the .desktop
file added in commit 148995544 is actually considered during tests depends
on /usr/bin/flatpak being installed. This isn't a safe assumption to make,
so use /bin/sh to test filtering of "prefix" commands.
https://bugzilla.gnome.org/show_bug.cgi?id=795488
gio/tests/desktop-app-info.c | 6 +++---
gio/tests/desktop-files/usr/applications/org.gnome.clocks.desktop | 5 ++++-
2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gio/tests/desktop-app-info.c b/gio/tests/desktop-app-info.c
index d425eb9e5..face99da3 100644
--- a/gio/tests/desktop-app-info.c
+++ b/gio/tests/desktop-app-info.c
@@ -667,10 +667,10 @@ test_search (void)
assert_search ("image viewer", "", FALSE, TRUE, NULL, NULL);
assert_search ("image viewer", "", TRUE, TRUE, NULL, NULL);
- /* There're flatpak apps installed as well - they should *not* match
- * the "flatpak" command in the Exec= line though.
+ /* There're "flatpak" apps (clocks) installed as well - they should *not*
+ * match the prefix command ("/bin/sh") in the Exec= line though.
*/
- assert_search ("flatpak", "", TRUE, FALSE, NULL, NULL);
+ assert_search ("sh", "gnome-terminal.desktop\n", TRUE, FALSE, NULL, NULL);
/* Obvious multi-word search */
assert_search ("gno hel", "yelp.desktop\n", TRUE, TRUE, NULL, NULL);
diff --git a/gio/tests/desktop-files/usr/applications/org.gnome.clocks.desktop
b/gio/tests/desktop-files/usr/applications/org.gnome.clocks.desktop
index 8cb4eba1a..92a6b35bc 100755
--- a/gio/tests/desktop-files/usr/applications/org.gnome.clocks.desktop
+++ b/gio/tests/desktop-files/usr/applications/org.gnome.clocks.desktop
@@ -342,7 +342,10 @@ Keywords[zh_HK]=time;timer;alarm;world clock;stopwatch;time zone;時間;計時
Keywords[zh_TW]=time;timer;alarm;world clock;stopwatch;time zone;時間;倒數;計時器;鬧鐘;鬧鈴;世界時鐘;碼表;時區;
Keywords[ug]=time;timer;alarm;world clock;stopwatch;time zone;ۋاقىت;ئۆلچىگۈچ;قوڭغۇراق;دۇنيا سائىتى;ۋاقىت
رايونى;
Keywords=time;timer;alarm;world clock;stopwatch;time zone;
-Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=gnome-clocks org.gnome.clocks
+# GDesktopAppInfo requires that the command exists, so use /bin/sh
+# rather than /usr/bin/flatpak, since that's guaranteed to exist on
+# all test systems (in particular CI machines).
+Exec=/bin/sh run --branch=stable --arch=x86_64 --command=gnome-clocks org.gnome.clocks
Icon=org.gnome.clocks
Terminal=false
Type=Application
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]