[gtk/introspection-test] Add an introspection api test
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/introspection-test] Add an introspection api test
- Date: Wed, 5 May 2021 01:02:33 +0000 (UTC)
commit 9b5188d3f18fbbd68bead7f5f3452e2474e7cc5e
Author: Matthias Clasen <mclasen redhat com>
Date: Tue May 4 20:39:52 2021 -0400
Add an introspection api test
Every beginning is small... just check one constant for now.
testsuite/introspection/api.py | 10 ++++++++++
testsuite/introspection/meson.build | 8 ++++++++
testsuite/meson.build | 4 ++++
3 files changed, 22 insertions(+)
---
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..119bb3f504
--- /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(meson.project_build_root()),
+ 'LD_PRELOAD=@0@/gtk/libgtk-4.so'.format(meson.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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]