[totem/bilelmoussaoui/meson-tests: 2/3] build: Add tests to validate appdata file
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/bilelmoussaoui/meson-tests: 2/3] build: Add tests to validate appdata file
- Date: Thu, 26 Sep 2019 09:45:56 +0000 (UTC)
commit a1860cade08794d9a5e2a604ac52c270e1e19ed4
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]