[fractal] meson: add tests to validate appdata/desktop file



commit ba288dcaf48696127607e1169eed51b9d33a2050
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Wed Jan 9 18:37:32 2019 +0000

    meson: add tests to validate appdata/desktop file

 fractal-gtk/res/meson.build | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/fractal-gtk/res/meson.build b/fractal-gtk/res/meson.build
index d6816945..bab3bab8 100644
--- a/fractal-gtk/res/meson.build
+++ b/fractal-gtk/res/meson.build
@@ -2,7 +2,7 @@ subdir('icons')
 
 desktop_conf = configuration_data()
 desktop_conf.set('icon', application_id)
-i18n.merge_file ('desktop-file',
+desktop_file = i18n.merge_file ('desktop-file',
   type: 'desktop',
   input: configure_file(
     input: files('org.gnome.Fractal.desktop.in.in'),
@@ -14,10 +14,21 @@ i18n.merge_file ('desktop-file',
   install: true,
   install_dir: join_paths (datadir, 'applications')
 )
+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
+
 
 appdata_conf = configuration_data()
 appdata_conf.set('appid', application_id)
-i18n.merge_file ('appdata-file',
+appdata_file = i18n.merge_file ('appdata-file',
   input: configure_file(
     input: files('org.gnome.Fractal.appdata.xml.in.in'),
     output: 'org.gnome.Fractal.appdata.xml.in',
@@ -28,5 +39,13 @@ i18n.merge_file ('appdata-file',
   install: true,
   install_dir: join_paths (datadir, 'metainfo')
 )
-
+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
 install_data('org.gnome.Fractal.gschema.xml', install_dir: join_paths(get_option('datadir'), 'glib-2.0', 
'schemas'))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]