[gnome-sound-recorder] meson: tests to validate appdata & desktop files



commit ae60e5026a58977bca3ba26568ea9f177989e6cb
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Fri Jan 11 15:28:28 2019 +0100

    meson: tests to validate appdata & desktop files

 data/appdata/meson.build | 11 ++++++++++-
 data/meson.build         | 12 +++++++++++-
 2 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/data/appdata/meson.build b/data/appdata/meson.build
index 42fa900..a5a78c2 100644
--- a/data/appdata/meson.build
+++ b/data/appdata/meson.build
@@ -1,4 +1,4 @@
-i18n.merge_file(
+appdata_file = i18n.merge_file(
   'appdata-file',
   input: '@0  appdata xml in'.format(application_id),
   output: '@0  appdata xml'.format(application_id),
@@ -6,3 +6,12 @@ i18n.merge_file(
   install: true,
   install_dir: join_paths(sound_recorder_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
\ No newline at end of file
diff --git a/data/meson.build b/data/meson.build
index 4b17e4b..5894af8 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -10,7 +10,7 @@ install_data(
   install_dir: join_paths(sound_recorder_datadir, icon_dir)
 )
 
-i18n.merge_file(
+desktop_file = i18n.merge_file(
   'desktop',
   input: '@0  desktop in'.format(application_id),
   output: '@0@.desktop'.format(application_id),
@@ -19,6 +19,16 @@ 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_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]