[epiphany] Meson: add tests to validate desktop & appdata files



commit b3e5844f85784fbde77d03fcccb85f4a5cedc7c0
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Thu Jan 10 01:54:37 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 492890e56..912484fe8 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -2,7 +2,7 @@ install_subdir('icons/hicolor',
   install_dir: join_paths(datadir, 'icons')
 )
 
-i18n.merge_file('desktop-file',
+desktop_file = i18n.merge_file('desktop-file',
   input: 'org.gnome.Epiphany.desktop.in',
   output: 'org.gnome.Epiphany.desktop',
   install: true,
@@ -10,14 +10,33 @@ i18n.merge_file('desktop-file',
   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
 
-i18n.merge_file('appdata-file',
+appdata_file = i18n.merge_file('appdata-file',
   input: 'org.gnome.Epiphany.appdata.xml.in',
   output: 'org.gnome.Epiphany.appdata.xml',
   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
 
 # We need three custom_target() calls because Meson doesn't have very
 # good support for GSettings yet. First, generate our GSettings enums


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