forked from AuroraMiddleware/gtk
Merge branch 'pixbuf-loader-check' into 'master'
Make testsuite fail if we lack pixbuf loaders See merge request GNOME/gtk!3348
This commit is contained in:
commit
3014649455
@ -384,7 +384,7 @@ pangocairo_dep = dependency('pangocairo', version: pango_req,
|
||||
fallback : ['pango', 'libpangocairo_dep'])
|
||||
pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_req,
|
||||
fallback : ['gdk-pixbuf', 'gdkpixbuf_dep'],
|
||||
default_options: ['man=false'])
|
||||
default_options: ['png=true', 'jpeg=true', 'builtin_loaders=png,jpeg', 'man=false'])
|
||||
epoxy_dep = dependency('epoxy', version: epoxy_req,
|
||||
fallback: ['libepoxy', 'libepoxy_dep'])
|
||||
harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false,
|
||||
|
@ -11,6 +11,7 @@ tests = [
|
||||
'encoding',
|
||||
'keysyms',
|
||||
'memorytexture',
|
||||
'pixbuf',
|
||||
'rectangle',
|
||||
'rgba',
|
||||
'seat',
|
||||
|
31
testsuite/gdk/pixbuf.c
Normal file
31
testsuite/gdk/pixbuf.c
Normal file
@ -0,0 +1,31 @@
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GSList *formats;
|
||||
gboolean have_png, have_jpeg;
|
||||
|
||||
have_png = FALSE;
|
||||
have_jpeg = FALSE;
|
||||
|
||||
formats = gdk_pixbuf_get_formats ();
|
||||
|
||||
for (GSList *l = formats; l; l = l->next)
|
||||
{
|
||||
GdkPixbufFormat *format = l->data;
|
||||
const char *name;
|
||||
|
||||
name = gdk_pixbuf_format_get_name (format);
|
||||
|
||||
if (strcmp (name, "png") == 0)
|
||||
have_png = TRUE;
|
||||
else if (strcmp (name, "jpeg") == 0)
|
||||
have_jpeg = TRUE;
|
||||
}
|
||||
|
||||
if (!have_png || !have_jpeg)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user