[pitivi] Meson: add tests to validate desktop/appdata files



commit 9e3192f76512a12896c183db33953fe2e1dd688e
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Wed Jan 9 20:24:01 2019 +0000

    Meson: add tests to validate desktop/appdata files

 data/meson.build | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index a1db6086..2ea82cf1 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -6,7 +6,7 @@ install_subdir('audiopresets', install_dir: pkgdatadir)
 install_subdir('videopresets', install_dir: pkgdatadir)
 install_subdir('gstpresets', install_dir: pkgdatadir)
 
-i18n.merge_file('org.pitivi.Pitivi.desktop',
+desktop_file = i18n.merge_file('org.pitivi.Pitivi.desktop',
     type: 'desktop',
     output : 'org.pitivi.Pitivi.desktop',
     input : 'org.pitivi.Pitivi.desktop.in',
@@ -14,7 +14,18 @@ i18n.merge_file('org.pitivi.Pitivi.desktop',
     install : true,
     install_dir : join_paths(get_option('datadir'), 'applications'))
 
-i18n.merge_file('org.pitivi.Pitivi.appdata.xml',
+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_file = i18n.merge_file('org.pitivi.Pitivi.appdata.xml',
     type: 'xml',
     output : 'org.pitivi.Pitivi.appdata.xml',
     input : 'org.pitivi.Pitivi.appdata.xml.in',
@@ -22,6 +33,16 @@ i18n.merge_file('org.pitivi.Pitivi.appdata.xml',
     install : true,
     install_dir : join_paths(get_option('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
+
 i18n.merge_file('org.pitivi.Pitivi-mime.xml',
     output : 'org.pitivi.Pitivi-mime.xml',
     input : 'org.pitivi.Pitivi-mime.xml.in',


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