[gnome-builder] build: Run tests validating desktop/appstream files



commit daaad807ffa95c1dd97d736826fe4c6314604742
Author: Patrick Griffis <tingping tingping se>
Date:   Wed Jun 14 22:31:54 2017 -0400

    build: Run tests validating desktop/appstream files

 data/meson.build |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 4882db1..a087bdf 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -1,6 +1,6 @@
 
 # Desktop launcher and description file.
-i18n.merge_file(
+desktop_file = i18n.merge_file(
   input: 'org.gnome.Builder.desktop.in.in',
   output: 'org.gnome.Builder.desktop',
   type: 'desktop',
@@ -9,8 +9,15 @@ i18n.merge_file(
   install_dir: join_paths(get_option('datadir'), 'applications'),
 )
 
+desktop_utils = find_program('desktop-file-validate', required: false)
+if desktop_utils.found()
+  test('Validate desktop file', desktop_utils,
+    args: [desktop_file]
+  )
+endif
+
 # Appdata file.
-i18n.merge_file(
+appdata_file = i18n.merge_file(
   input: 'org.gnome.Builder.appdata.xml.in',
   output: 'org.gnome.Builder.appdata.xml',
   po_dir: '../po',
@@ -18,6 +25,14 @@ i18n.merge_file(
   install_dir: join_paths(get_option('datadir'), 'appdata'),
 )
 
+appstream_util = find_program('appstream-util', required: false)
+if appstream_util.found()
+  test('Validate appstream file', appstream_util,
+    # FIXME: Screenshots are wrong size for 'validate'
+    args: ['validate-relax', appdata_file]
+  )
+endif
+
 # D-Bus service file.
 dbusconf = configuration_data()
 dbusconf.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))


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