tests: Maybe skip introspection tests
authorMatthias Clasen <mclasen@redhat.com>
Tue, 20 Dec 2022 02:18:16 +0000 (21:18 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 20 Dec 2022 03:38:38 +0000 (22:38 -0500)
If we don't find the python gi module,
skip the introspection test.

testsuite/introspection/api.py
testsuite/introspection/meson.build

index a2feac37ea6fd2c905556bc1633e715ef2972e47..9bbbedfe13f6afce85eb4c1ccb500509c19f8486 100755 (executable)
@@ -14,7 +14,10 @@ if hasattr(os, 'add_dll_directory'):
         if path != '' and os.path.isdir(path):
             os.add_dll_directory(path)
 
-import gi
+try:
+    import gi
+except ImportError:
+    sys.exit(77) # skip this test, gi module is not available
 
 gi.require_version('Gtk', '4.0')
 
index c64a0f54d358f698eeaf8b4bb0ecb326e74bb1e2..a30c68735341fdecc16b008c2850772f1e912e34 100644 (file)
@@ -1,5 +1,3 @@
-py = import('python').find_installation('python3', modules: ['gi'])
-
 env = environment()
 env.prepend('GI_TYPELIB_PATH',
   project_build_root / 'gtk',