[polari] build: Specify test dependencies



commit 0d406ac56179832cb4f708a96a8c6a3f0fcc6c58
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Apr 28 21:27:56 2021 +0200

    build: Specify test dependencies
    
    `meson test` no longer rebuilds all dependencies, so make sure the
    files that are tested actually exist.
    
    https://gitlab.gnome.org/GNOME/polari/-/merge_requests/183

 data/appdata/meson.build | 20 +++++++++++---------
 data/meson.build         | 15 ++++++++-------
 2 files changed, 19 insertions(+), 16 deletions(-)
---
diff --git a/data/appdata/meson.build b/data/appdata/meson.build
index 9cc74bcc..52a97767 100644
--- a/data/appdata/meson.build
+++ b/data/appdata/meson.build
@@ -1,25 +1,27 @@
-appdata = app_id + '.appdata.xml'
-i18n.merge_file(appdata,
-  input: appdata + '.in',
-  output: appdata,
+appdata_name = app_id + '.appdata.xml'
+appdata = i18n.merge_file(appdata_name,
+  input: appdata_name + '.in',
+  output: appdata_name,
   po_dir: '../../po',
   install: true,
   install_dir: metainfodir
 )
 
 if (appstream_util.found())
-  test('Validating ' + appdata,
+  test('Validating ' + appdata_name,
     appstream_util,
-    args: ['validate', '--nonet', appdata],
-    workdir: meson.current_build_dir()
+    args: ['validate', '--nonet', appdata.full_path()],
+    workdir: meson.current_build_dir(),
+    depends: [appdata]
   )
 
   r = run_command(appstream_util, '--help')
   if (r.stdout().contains('validate-version'))
     test('Checking release entry for @0@'.format(meson.project_version()),
       appstream_util,
-      args: ['validate-version', appdata, meson.project_version()],
-      workdir: meson.current_build_dir()
+      args: ['validate-version', appdata.full_path(), meson.project_version()],
+      workdir: meson.current_build_dir(),
+      depends: [appdata]
     )
   endif
 endif
diff --git a/data/meson.build b/data/meson.build
index 849cdbbc..bee59abf 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -1,10 +1,10 @@
 subdir('appdata')
 subdir('icons')
 
-desktop_file = app_id + '.desktop'
-i18n.merge_file(desktop_file,
-  input: desktop_file + '.in',
-  output: desktop_file,
+desktop_filename = app_id + '.desktop'
+desktop_file = i18n.merge_file(desktop_filename,
+  input: desktop_filename + '.in',
+  output: desktop_filename,
   po_dir: '../po',
   install: true,
   install_dir: desktopdir,
@@ -12,10 +12,11 @@ i18n.merge_file(desktop_file,
 )
 
 if (desktop_file_validate.found())
-  test('Validating ' + desktop_file,
+  test('Validating ' + desktop_filename,
     desktop_file_validate,
-    args: [desktop_file],
-    workdir: meson.current_build_dir()
+    args: [desktop_file.full_path()],
+    workdir: meson.current_build_dir(),
+    depends: [desktop_file]
   )
 endif
 


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