summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilal Elmoussaoui <bil.elmoussaoui@gmail.com>2019-09-26 11:44:46 +0200
committerBastien Nocera <hadess@hadess.net>2019-09-26 11:58:47 +0200
commit0bb40981a737db68640247ddec9585d5ceb5ab1a (patch)
tree69c6e6fdbaff1ab0eaf0cb3ff6071abbbbd0a315
parenta3836901488c8ee1e86a040249eaa05e38a1e8f6 (diff)
downloadtotem-0bb40981a737db68640247ddec9585d5ceb5ab1a.tar.gz
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.
-rw-r--r--data/appdata/meson.build22
1 files 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