[gnome-chess] meson: tests to validate appdata & desktop files
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chess] meson: tests to validate appdata & desktop files
- Date: Thu, 10 Jan 2019 18:25:12 +0000 (UTC)
commit 176d6c5f0f755e1cbe24aaf47165a57e82c3a036
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date: Thu Jan 10 18:25:00 2019 +0000
meson: tests to validate appdata & desktop files
data/meson.build | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 04cc741..cd8ef12 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -11,7 +11,7 @@ install_data('engines.conf',
)
# The desktop file
-i18n.merge_file(
+desktop_file = i18n.merge_file(
input: '@0 desktop in'.format(application_id),
output: '@0@.desktop'.format(application_id),
type: 'desktop',
@@ -19,9 +19,20 @@ i18n.merge_file(
install: true,
install_dir: join_paths(datadir, 'applications')
)
+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
+
# The appdata file
-i18n.merge_file(
+appdata_file = i18n.merge_file(
input: '@0 appdata xml in'.format(application_id),
output: '@0 appdata xml'.format(application_id),
type: 'xml',
@@ -29,6 +40,15 @@ i18n.merge_file(
install: true,
install_dir: join_paths(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
install_data('@0 gschema xml'.format(application_id),
install_dir: join_paths(datadir, 'glib-2.0', 'schemas')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]