[gnome-system-monitor: 2/7] Add data file tests.



commit 24491ce2bc9986181385948bc499b4105773f23b
Author: Félix Piédallu <felix piedallu me>
Date:   Mon Feb 19 19:38:11 2018 +0100

    Add data file tests.

 meson.build     |   25 +++++++++++++++++++++----
 src/meson.build |    1 -
 2 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/meson.build b/meson.build
index 4471d8a..bb96c6c 100644
--- a/meson.build
+++ b/meson.build
@@ -112,11 +112,12 @@ configure_file(
 ################################################################################
 # Generate files
 
+desktop_files = []
 foreach file : [
     'gnome-system-monitor.desktop',
     'gnome-system-monitor-kde.desktop',
   ]
-  i18n.merge_file(
+  desktop_files += i18n.merge_file(
     input : configure_file(
       configuration: dataconf,
       input : file + '.in.in',
@@ -130,7 +131,7 @@ foreach file : [
   )
 endforeach
 
-i18n.merge_file(
+appdata_file = i18n.merge_file(
   input : 'gnome-system-monitor.appdata.xml.in',
   output: 'gnome-system-monitor.appdata.xml',
   po_dir: 'po',
@@ -151,9 +152,24 @@ i18n.merge_file(
 )
 
 
-# appdata_validate = find_program('appdata-validate')
-# desktop_validate = find_program('desktop-file-validate')
+appstream_util = find_program('appstream-util', required: false)
+if appstream_util.found()
+  test('validate_appdata',
+    appstream_util,
+    args: [ 'validate-relax', '--nonet', appdata_file ],
+  )
+endif
+
+desktop_validate = find_program('desktop-file-validate', required: false)
+if desktop_validate.found()
+  test('validate_desktop',
+    desktop_validate,
+    args: [ desktop_files ],
+  )
+endif
 
+################################################################################
+# Subdirectories
 
 rootInclude = include_directories('.')
 
@@ -162,6 +178,7 @@ subdir('scripts')
 subdir('src')
 subdir('help')
 
+
 message('\n'.join(['',
 'Configuration:',
 '',
diff --git a/src/meson.build b/src/meson.build
index 3c4d294..76c5320 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -76,7 +76,6 @@ gsm_schemas = configure_file(
 
 gsm_gsettings = gnome.mkenums('org.gnome.gnome-system-monitor.enums.xml',
   sources: system_monitor_headers,
-  # symbol_prefix: prefix to use for the symbols
   comments: '<!-- @comment@ -->',
   fhead:    '<schemalist>',
   vhead:    '  <@type@ id=\'org.gnome.gnome-system-monitor.@EnumName@\'>',


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