Skip to content

Commit ea95296

Browse files
eli-schwartzdcbaker
andcommitted
update gnome test to cover built gresource files
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
1 parent 28835cc commit ea95296

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ct_simple_gresource = custom_target(
2+
input : '../simple.gresource.xml',
3+
output : 'simple-ct.gresource.xml',
4+
command : [copyfile, '@INPUT@', '@OUTPUT@'])

test cases/frameworks/7 gnome/resources/meson.build

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ gnome.compile_resources('simple-resources',
3030
test('simple resource test (gresource)', find_program('resources.py'))
3131

3232
if not pretend_glib_old and glib.version() >= '2.52.0'
33-
# This test cannot pass if GLib version is older than 9.99.9.
34-
# Meson will raise an error if the user tries to use the 'dependencies'
35-
# argument and the version of GLib is too old for generated resource
36-
# dependencies to work correctly.
33+
# This test cannot pass if GLib version is too old. Generated resource
34+
# dependencies do not work correctly and Meson will raise an error if the
35+
# user tries to use either the 'dependencies' kwarg or a gresource file that
36+
# is itself generated.
3737
generated_resources = gnome.compile_resources('generated-resources',
3838
'generated.gresource.xml',
3939
source_dir : '../resources-data',
@@ -44,6 +44,25 @@ if not pretend_glib_old and glib.version() >= '2.52.0'
4444
'generated-main.c', generated_resources,
4545
dependencies: gio)
4646
test('generated resource test', generated_res_exe)
47+
48+
# Test with a CustomTarget
49+
subdir('generated')
50+
51+
ct_resources = gnome.compile_resources(
52+
'ct-resources',
53+
ct_simple_gresource,
54+
install_header : true,
55+
export : true,
56+
source_dir : '../resources-data',
57+
c_name : 'simple_resources')
58+
59+
cti_resources = gnome.compile_resources(
60+
'cti-resources',
61+
ct_simple_gresource[0],
62+
install_header : true,
63+
export : true,
64+
source_dir : '../resources-data',
65+
c_name : 'simple_resources')
4766
endif
4867

4968
# Test build_by_default

test cases/frameworks/7 gnome/test.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"installed": [
3+
{"type": "file", "file": "usr/include/ct-resources.h"},
4+
{"type": "file", "file": "usr/include/cti-resources.h"},
35
{"type": "file", "file": "usr/include/enums.h"},
46
{"type": "file", "file": "usr/include/enums2.h"},
57
{"type": "file", "file": "usr/include/enums3.h"},

0 commit comments

Comments
 (0)