diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-05-06 00:52:06 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-05-06 00:52:06 +0000 |
commit | 4e2a263c1f0f6441b6751501efc93e5e6a3041a6 (patch) | |
tree | db10dd36d785405b742edb852ed90779a34d4a33 | |
parent | c8eeb46aa5d0003c743366c28de7201ab10372bb (diff) | |
parent | 6a24e0c7c381ceeb842dae7fe3f8fa003efc6ba1 (diff) | |
download | gtk+-4e2a263c1f0f6441b6751501efc93e5e6a3041a6.tar.gz |
Merge branch 'introspection-test' into 'master'
Add an introspection api test
See merge request GNOME/gtk!3514
-rw-r--r-- | meson.build | 2 | ||||
-rwxr-xr-x | testsuite/introspection/api.py | 10 | ||||
-rw-r--r-- | testsuite/introspection/meson.build | 8 | ||||
-rw-r--r-- | testsuite/meson.build | 4 |
4 files changed, 24 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 93231f9025..b0314179a8 100644 --- a/meson.build +++ b/meson.build @@ -733,6 +733,8 @@ int main () { endif endif +project_build_root = meson.current_build_dir() + subdir('gtk/css') subdir('gdk') subdir('gsk') diff --git a/testsuite/introspection/api.py b/testsuite/introspection/api.py new file mode 100755 index 0000000000..c35b2b7448 --- /dev/null +++ b/testsuite/introspection/api.py @@ -0,0 +1,10 @@ +#! /usr/bin/env python3 + +import sys +import gi + +gi.require_version('Gtk', '4.0') + +from gi.repository import Gtk + +assert isinstance(Gtk.INVALID_LIST_POSITION, int), 'Gtk.INVALID_LIST_POSITION is not an int' diff --git a/testsuite/introspection/meson.build b/testsuite/introspection/meson.build new file mode 100644 index 0000000000..58eea5aca2 --- /dev/null +++ b/testsuite/introspection/meson.build @@ -0,0 +1,8 @@ + +test('api', + find_program('api.py', dirs: meson.current_source_dir()), + suite: ['introspection'], + env: [ + 'GI_TYPELIB_PATH=@0@/gtk:/usr/lib64/girepository-1.0'.format(project_build_root), + 'LD_PRELOAD=@0@/gtk/libgtk-4.so'.format(project_build_root), + ]) diff --git a/testsuite/meson.build b/testsuite/meson.build index fafe6ea140..0b75c90811 100644 --- a/testsuite/meson.build +++ b/testsuite/meson.build @@ -56,3 +56,7 @@ subdir('css') subdir('a11y') subdir('tools') subdir('reftests') + +if build_gir + subdir('introspection') +endif |