summaryrefslogtreecommitdiff
path: root/test cases/frameworks
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-10-05 16:40:09 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2022-10-28 13:06:52 +0300
commit2fe3271f773cb4207967271b4a8fb8daa131e4c8 (patch)
tree6f37a4f1719be7df24a85be119a1792f766692eb /test cases/frameworks
parente68fcac919b332c7f9469672a243d2aab1bfea0a (diff)
downloadmeson-2fe3271f773cb4207967271b4a8fb8daa131e4c8.tar.gz
gnome: allow custom targets as gdbus-codegen inputs
Custom targets as sources to `gnome.gdbus_codegen` worked until version 0.60 of Meson, but broke in 0.61 because of the conversion to typed_pos_args and typed_kwargs. Reinstate this by adding custom targets to the decorators and annotations. While generators also used to work, they are a bit tricky because gdbus_codegen desugars to two custom_targets and therefore the generator is invoked twice. This should not be a problem, but be explicit and leave that to a separate commit to highlight the problem. Fixes: 53a187ba2 ("modules/gnome: use typed_pos_args for gdbus_codegen", 2021-11-01) Fixes: ef52e6093 ("modules/gnome: use typed_kwargs for gdbus_codegen", 2021-11-08)
Diffstat (limited to 'test cases/frameworks')
-rw-r--r--test cases/frameworks/7 gnome/copyfile.py (renamed from test cases/frameworks/7 gnome/resources/copyfile.py)0
-rw-r--r--test cases/frameworks/7 gnome/gdbus/meson.build21
-rw-r--r--test cases/frameworks/7 gnome/meson.build2
-rw-r--r--test cases/frameworks/7 gnome/resources/meson.build2
4 files changed, 23 insertions, 2 deletions
diff --git a/test cases/frameworks/7 gnome/resources/copyfile.py b/test cases/frameworks/7 gnome/copyfile.py
index 7e44c48dd..7e44c48dd 100644
--- a/test cases/frameworks/7 gnome/resources/copyfile.py
+++ b/test cases/frameworks/7 gnome/copyfile.py
diff --git a/test cases/frameworks/7 gnome/gdbus/meson.build b/test cases/frameworks/7 gnome/gdbus/meson.build
index 682abfffe..d749033e9 100644
--- a/test cases/frameworks/7 gnome/gdbus/meson.build
+++ b/test cases/frameworks/7 gnome/gdbus/meson.build
@@ -58,6 +58,27 @@ else
includes = include_directories('..')
endif
+# check that custom targets work
+gdbus_xml_ct = custom_target('built xml sources for gdbus',
+ output: 'com.example.SampleCustomTarget.xml',
+ input: 'data/com.example.Sample.xml',
+ command : [copyfile, '@INPUT@', '@OUTPUT@'])
+
+gdbus_src_ct = gnome.gdbus_codegen(
+ 'generated-gdbus-customtarget-src',
+ gdbus_xml_ct,
+ interface_prefix : 'com.example.',
+ namespace : 'Sample',
+ annotations : [],
+)
+gdbus_src_cti = gnome.gdbus_codegen(
+ 'generated-gdbus-customtargetindex-src',
+ gdbus_xml_ct[0],
+ interface_prefix : 'com.example.',
+ namespace : 'Sample',
+ annotations : [],
+)
+
gdbus_exe = executable('gdbus-test', 'gdbusprog.c',
gdbus_src,
include_directories : includes,
diff --git a/test cases/frameworks/7 gnome/meson.build b/test cases/frameworks/7 gnome/meson.build
index 9f8640609..920bc6a82 100644
--- a/test cases/frameworks/7 gnome/meson.build
+++ b/test cases/frameworks/7 gnome/meson.build
@@ -1,5 +1,7 @@
project('gobject-introspection', 'c')
+copyfile = find_program('copyfile.py')
+
glib = dependency('glib-2.0', required: false)
if not glib.found()
error('MESON_SKIP_TEST glib not found.')
diff --git a/test cases/frameworks/7 gnome/resources/meson.build b/test cases/frameworks/7 gnome/resources/meson.build
index 180b33851..60fc8481e 100644
--- a/test cases/frameworks/7 gnome/resources/meson.build
+++ b/test cases/frameworks/7 gnome/resources/meson.build
@@ -1,8 +1,6 @@
# There are two tests here, because the 2nd one depends on a version of
# GLib (2.51.1) that is very recent at the time of writing.
-copyfile = find_program('copyfile.py')
-
simple_gresource = configure_file(
input : 'simple.gresource.xml',
output : 'simple-gen.gresource.xml',