1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-26 04:35:39 +03:00
aports/testing/gnome-maps/Add-validation-tests-for-desktop-and-appdata.patch
2019-06-17 15:09:06 -03:00

55 lines
1.2 KiB
Diff

Upstream: Yes
Reason: Actually run tests
diff --git a/data/meson.build b/data/meson.build
index 349ff25..2be4ee7 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -13,7 +13,7 @@ install_data(
desktop = app_id + '.desktop'
-custom_target('desktop-file',
+desktop_file = custom_target('desktop-file',
input: desktop + '.in',
output: desktop,
install: true,
@@ -32,7 +32,7 @@ install_data(
appdata = app_id + '.appdata.xml'
-i18n.merge_file(
+appdata_file = i18n.merge_file(
appdata,
input: appdata + '.in',
output: appdata,
@@ -53,4 +53,28 @@ configure_file(
install_dir: join_paths(datadir, 'dbus-1', 'services')
)
-subdir('icons')
+desktop_file_validate = find_program('desktop-file-validate', required: false)
+if desktop_file_validate.found()
+ test(
+ 'validate-desktop',
+ desktop_file_validate,
+ args: [
+ desktop_file.full_path()
+ ]
+ )
+endif
+
+appstream_util = find_program('appstream-util', required: false)
+if appstream_util.found()
+ test(
+ 'validate-appdata',
+ appstream_util,
+ args: [
+ 'validate-relax',
+ '--nonet',
+ appdata_file.full_path()
+ ]
+ )
+endif
+
+subdir('icons')
\ No newline at end of file