[swell-foop/meson-tests] Meson: add tests to validate the desktop/appdata filse



commit 1936dbc492562f35fbb5a3aee3682a3b8af88720
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Sun Jan 20 14:07:11 2019 +0000

    Meson: add tests to validate the desktop/appdata filse

 data/meson.build | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 55fd1a0..379c5a8 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -21,7 +21,7 @@ install_data('swell-foop.css',
 desktop = 'org.gnome.SwellFoop.desktop'
 
 # Desktop file
-i18n.merge_file(
+desktop_file = i18n.merge_file(
   input: desktop + '.in',
   output: desktop,
   type: 'desktop',
@@ -29,17 +29,36 @@ i18n.merge_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 = 'org.gnome.SwellFoop.appdata.xml'
 
 # Appdata
-i18n.merge_file(
+appdata_file = i18n.merge_file(
   input: appdata + '.in',
   output: appdata,
   po_dir: podir,
   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
 
 # Gschema
 install_data('org.gnome.swell-foop.gschema.xml',


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