[gnome-sudoku/meson-tests] Meson: add tests to validate desktop/appdata files



commit bfcd9743c79455c60b3f21389f6dcee701c9554c
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Sun Jan 20 17:29:05 2019 +0000

    Meson: add tests to validate desktop/appdata files

 data/meson.build | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index b40704e..9492dc9 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -2,7 +2,7 @@ resource_files = files('gnome-sudoku.gresource.xml')
 
 resources = gnome.compile_resources('gnome-sudoku', resource_files)
 
-desktop = i18n.merge_file('desktop',
+desktop_file = i18n.merge_file('desktop',
   input: '@0  desktop in'.format(application_id),
   output: '@0@.desktop'.format(application_id),
   install: true,
@@ -10,14 +10,33 @@ desktop = i18n.merge_file('desktop',
   po_dir: '../po',
   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_file.full_path()
+    ]
+  )
+endif
 
-appdata = i18n.merge_file('appdata',
+appdata_file = i18n.merge_file('appdata',
   input: '@0  appdata xml in'.format(application_id),
   output: '@0  appdata xml'.format(application_id),
   install: true,
   install_dir: join_paths(datadir, 'metainfo'),
   po_dir: '../po'
 )
+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('@0  gschema xml'.format(application_id),
   install_dir: join_paths(datadir, 'glib-2.0', 'schemas')


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