[gnome-boxes] data/meson.build: Validate desktop and appdata file



commit 5dce3b78ac18ef6094f2c4d3fb489ead0b158a1f
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Tue Dec 11 10:02:17 2018 +0000

    data/meson.build: Validate desktop and appdata file
    
    Add tests to validate desktop file using desktop-file-validate
    Also validate the appdata file using appstream-util

 data/meson.build | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/data/meson.build b/data/meson.build
index 6e36b3cf..f770c918 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -32,6 +32,16 @@ desktop = i18n.merge_file (
   po_dir: po_dir,
   type: 'desktop'
 )
+desktop_file_validate = find_program ('desktop-file-validate', required: false)
+if desktop_file_validate.found()
+  test(
+    'validate-desktop',
+    desktop_file_validate,
+    args: [
+      desktop.full_path()
+    ]
+  )
+endif
 
 dbus_conf = configuration_data ()
 dbus_conf.set ('bindir', join_paths (get_option ('prefix'), get_option ('bindir')))
@@ -55,7 +65,7 @@ configure_file (
 
 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.Boxes.appdata.xml.in'),
     output: 'org.gnome.Boxes.appdata.xml.in',
@@ -66,6 +76,15 @@ i18n.merge_file ('appdata-file',
   install: true,
   install_dir: join_paths (data_dir, 'metainfo')
 )
+appstream_util = find_program('appstream-util', required: false)
+if appstream_util.found()
+  test(
+    'validate-appdata', appstream_util,
+    args: [
+      'validate-relax', appdata_file.full_path()
+    ]
+  )
+endif
 
 gsettings_conf = configuration_data ()
 gsettings_conf.set ('GETTEXT_PACKAGE', meson.project_name ())


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