[totem/bilelmoussaoui/meson-tests: 8/9] build: Add tests to validate appdata file



commit 0bb40981a737db68640247ddec9585d5ceb5ab1a
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Thu Sep 26 11:44:46 2019 +0200

    build: Add tests to validate appdata file
    
    The flatpak CI template already runs ninja tests for us.
    Let's use that to ensure the appdata file is always valid.

 data/appdata/meson.build | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/data/appdata/meson.build b/data/appdata/meson.build
index 7f82d374d..60b0aec23 100644
--- a/data/appdata/meson.build
+++ b/data/appdata/meson.build
@@ -1,8 +1,18 @@
 appdata = 'org.gnome.Totem.appdata.xml'
 
-i18n.merge_file ('appdata',
-                 input: appdata + '.in',
-                 output: appdata,
-                 install: true,
-                 install_dir: join_paths(totem_datadir, 'metainfo'),
-                 po_dir: po_dir,)
+appdata_file = i18n.merge_file (
+    'appdata',
+    input: appdata + '.in',
+    output: appdata,
+    install: true,
+    install_dir: join_paths(totem_datadir, 'metainfo'),
+    po_dir: po_dir,)
+
+# Validate Appdata
+appstream_util = find_program('appstream-util', required: false)
+if appstream_util.found()
+  test(
+      'validate-appdata', appstream_util,
+      args: ['validate', '--nonet', appdata_file.full_path()]
+      )
+endif


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