[gtk/gir-test] Add a gir test
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gir-test] Add a gir test
- Date: Sat, 16 Jan 2021 03:57:15 +0000 (UTC)
commit 31267f1c4865674ed3c87f24eb266703998a21c5
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jan 15 22:14:04 2021 -0500
Add a gir test
This test doesn't test much, but it loads Gtk-4.0.gir
from python and creates a window, just to see that things
work.
testsuite/gtk/meson.build | 15 +++++++++------
testsuite/gtk/testgir | 2 +-
2 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build
index e578611c0b..31cc5a2e04 100644
--- a/testsuite/gtk/meson.build
+++ b/testsuite/gtk/meson.build
@@ -268,13 +268,16 @@ foreach test : focus_chain_tests
)
endforeach
-if get_option('introspection').enabled()
+if build_gir
+ python = find_program ('python3')
env = environment()
- env.set('LD_LIBRARY_PATH', meson.project_build_root() + '/gtk')
- env.set('GI_TYPELIB_DIR', meson.project_build_root() + '/gtk')
- test('testgir',
- env: env)
-fi
+ env.set('LD_LIBRARY_PATH', join_paths(meson.build_root(), 'gtk'))
+ env.set('GI_TYPELIB_DIR', join_paths(meson.build_root(), 'gtk'))
+ test('testgir', python,
+ args: [ join_paths(meson.current_source_dir(), 'testgir') ],
+ env: env,
+ suite: [ 'gtk', 'gir' ])
+endif
if get_option('install-tests')
foreach t : tests
diff --git a/testsuite/gtk/testgir b/testsuite/gtk/testgir
index 42355aa59b..b3e494c00e 100644
--- a/testsuite/gtk/testgir
+++ b/testsuite/gtk/testgir
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#! /usr/bin/python3
import gi
gi.require_version('Gtk', '4.0')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]