File: meson.build

package info (click to toggle)
gdk-pixbuf 2.38.1+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 25,316 kB
  • sloc: ansic: 32,004; xml: 488; python: 76; sh: 60; perl: 56; makefile: 47; sed: 16
file content (169 lines) | stat: -rw-r--r-- 4,535 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# Resources; we cannot use gnome.compile_resources() here, because we need to
# override the environment in order to use the utilities we just built instead
# of the system ones
resources_c = custom_target('resources.c',
  input: 'resources.gresource.xml',
  output: 'resources.c',
  command: [
    gen_resources,
    '--pixdata=@0@'.format(gdk_pixbuf_pixdata.full_path()),
    '--loaders=@0@'.format(loaders_cache.full_path()),
    '--sourcedir=@0@'.format(meson.current_source_dir()),
    '--source',
    '@INPUT@',
    '@OUTPUT@',
  ],
  depends: [
    gdk_pixbuf_pixdata,
    loaders_cache,
  ],
)

resources_h = custom_target('resources.h',
  input: 'resources.gresource.xml',
  output: 'resources.h',
  command: [
    gen_resources,
    '--pixdata=@0@'.format(gdk_pixbuf_pixdata.full_path()),
    '--loaders=@0@'.format(loaders_cache.full_path()),
    '--sourcedir=@0@'.format(meson.current_source_dir()),
    '--header',
    '@INPUT@',
    '@OUTPUT@',
  ],
  depends: [
    gdk_pixbuf_pixdata,
    loaders_cache,
  ],
)

# [ test name, [ test suites ], needs_resources (opt) ]
#
# test suites:
#  - conform: Behavior conformance test
#  - security: CVEs and the like
#  - slow: Needs special timeout value
#  - format: Per-format test
#  - io: Loading/saving
#  - ops: Pixel operations
installed_tests = [
  [ 'animation', ['format'], ],
  [ 'cve-2015-4491', ['security'], true ],
  [ 'pixbuf-fail', ['conform', 'slow'], ],
  [ 'pixbuf-icon-serialize', ['conform'], ],
  [ 'pixbuf-randomly-modified', ['slow'], ],
  [ 'pixbuf-threads', ['io'], ],
  [ 'pixbuf-gif', ['io'], ],
  [ 'pixbuf-icc', ['io'], ],
  [ 'pixbuf-jpeg', ['format'], ],
  [ 'pixbuf-dpi', ['io'], ],
  [ 'pixbuf-pixdata', ['format'], true ],
  [ 'pixbuf-stream', ['io'], ],
  [ 'pixbuf-reftest', ['conform'], ],
  [ 'pixbuf-resource', ['io'], true ],
  [ 'pixbuf-scale', ['ops'], ],
  [ 'pixbuf-scale-two-step', ['ops'], ],
  [ 'pixbuf-short-gif-write', ['format'], ],
  [ 'pixbuf-gif-circular-table', ['format'], ],
  [ 'pixbuf-save', ['io'] ],
  [ 'pixbuf-readonly-to-mutable', ['conform'], ],
  [ 'pixbuf-composite', ['ops'], ],
  [ 'pixbuf-area-updated', ['slow'], ],
]

test_data = [
  'test-image.png',
  'test-animation.gif',
  '1_partyanimsm2.gif',
  'test-animation.ani',
  'icc-profile.jpeg',
  'icc-profile.png',
  'dpi.jpeg',
  'dpi.png',
  'dpi.tiff',
  'premature-end.png',
  'premature-end.jpg',
  'bug143608-comment.jpg',
  'bug725582-testrotate.jpg',
  'bug725582-testrotate.png',
  'cve-2015-4491.bmp',
  'large.png',
  'large.jpg',
  'bug775218.jpg',
  'test-image.pixdata',
  'test-image-rle.pixdata',
  'bug775693.pixdata',
  'bug775229.pixdata',
  'aero.gif',
]

installed_test_bindir = join_paths(gdk_pixbuf_libexecdir, 'installed-tests', meson.project_name())
installed_test_datadir = join_paths(gdk_pixbuf_datadir, 'installed-tests', meson.project_name())

if get_option('installed_tests')
  install_data(test_data, install_dir: installed_test_bindir)
  install_subdir('test-images', install_dir: installed_test_bindir)
endif

test_deps = gdk_pixbuf_deps + [ gdkpixbuf_dep ]

foreach t: installed_tests
  test_name = t[0]
  test_sources = [ test_name + '.c', 'test-common.c' ]
  test_suites = t[1]
  needs_resources = t.get(2, false)
  if needs_resources
    test_sources += [ resources_c, resources_h ]
  endif

  custom_target(test_name + '.test',
    output: test_name + '.test',
    command: [
      gen_installed_test,
      '--testbindir=@0@'.format(installed_test_bindir),
      '--testbin=@0@'.format(test_name),
      '@OUTPUT@',
    ],
    install: get_option('installed_tests'),
    install_dir: installed_test_datadir,
  )

  test_bin = executable(test_name, test_sources,
    dependencies: test_deps,
    include_directories: [
      root_inc,
      gdk_pixbuf_inc,
    ],
    c_args: common_cflags,
    install: get_option('installed_tests'),
    install_dir: installed_test_bindir,
  )

  # Two particularly slow tests
  if test_suites.contains('slow')
    timeout = 300
  else
    timeout = 30
  endif

  test(test_name, test_bin,
    suite: test_suites,
    args: [ '-k', '--tap' ],
    env: [
      'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
      'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
      'GDK_PIXBUF_MODULE_FILE=@0@'.format(loaders_cache.full_path()),
    ],
    timeout: timeout,
  )
endforeach

executable('pixbuf-read',
  'pixbuf-read.c',
  dependencies: test_deps,
  include_directories: [
    root_inc,
    include_directories('../gdk-pixbuf')
  ],
  c_args: common_cflags,
)