[gitg/validate-appdata: 1/2] Appdata: Add tests to validate the AppData and desktop files.
- From: Alberto Fanjul <albfan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/validate-appdata: 1/2] Appdata: Add tests to validate the AppData and desktop files.
- Date: Mon, 10 Oct 2022 22:57:25 +0000 (UTC)
commit a8bef6753b305d2c02be8c98a6ec2e755f212265
Author: Adwait Rawat <adwait rawat gmail com>
Date: Fri May 24 21:15:27 2019 +0900
Appdata: Add tests to validate the AppData and desktop files.
data/meson.build | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 2413531d..bac28566 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -5,7 +5,7 @@ desktop = 'org.gnome.gitg.desktop'
desktop_config = configuration_data()
desktop_config.set('icon', application_id)
desktop_config.set('binary', gitg_name)
-i18n.merge_file(
+desktop_file = i18n.merge_file(
type: 'desktop',
input: configure_file(
input: desktop + '.in.in',
@@ -18,6 +18,17 @@ i18n.merge_file(
install_dir: join_paths(gitg_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
+
schema_conf = configuration_data()
schema_conf.set('GETTEXT_PACKAGE', gitg_gettext)
schema_conf.set('APPLICATION_ID', application_id)
@@ -40,7 +51,7 @@ appdata = 'org.gnome.gitg.appdata.xml'
appdata_config = configuration_data()
appdata_config.set('app-id', application_id)
appdata_config.set('gettext', gitg_name)
-i18n.merge_file(
+appdata_file = i18n.merge_file(
type: 'xml',
input: configure_file(
input: appdata + '.in.in',
@@ -52,6 +63,15 @@ i18n.merge_file(
install: true,
install_dir: join_paths(gitg_datadir, 'metainfo'),
)
+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
install_man(
'gitg.1',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]