diff options
author | Florian Müllner <fmuellner@gnome.org> | 2018-04-24 15:21:06 +0200 |
---|---|---|
committer | Florian Müllner <fmuellner@gnome.org> | 2018-04-24 18:36:05 +0200 |
commit | 634355560551bf56d8394899bd6f9c2321fd0142 (patch) | |
tree | 112a149ec19d7b6dd7e8bc1fbdc5667d6869b159 | |
parent | 1e2579da2c115f09ab36015c6a02fb3e767e8d68 (diff) | |
download | glib-634355560551bf56d8394899bd6f9c2321fd0142.tar.gz |
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
-rw-r--r-- | gio/tests/desktop-app-info.c | 6 | ||||
-rwxr-xr-x | 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 |