tests: Search the appropriate directories for our GIR XML inputs

During "as-installed" testing, we should search the GIR_DIR for GIR XML,
instead of hard-coding that it is `${prefix}/share/gir-1.0`. This is
not the case on at least Debian, in order to make it possible to
install more than one architecture's flavour of `GLib-2.0.gir`,
which contains some architecture-specific `#define`s.

Also search GOBJECT_INTROSPECTION_DATADIR/GIR_SUFFIX (in practice
something like `/usr/share/gir-1.0` in all cases) to accommodate
distributions like Debian that move the architecture-independent
majority of GIR XML into /usr/share to avoid duplication, leaving
only the architecture-specific minority of files like `GLib-2.0.gir`
in the GIR_DIR.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie
2025-02-21 12:35:16 +00:00
parent 135850a534
commit 9f18bb6258
12 changed files with 79 additions and 35 deletions

View File

@@ -34,18 +34,4 @@ test(
protocol : 'tap',
)
# TAP test runner for Python tests
if installed_tests_enabled
lib_path = fs.relative_to(
meson.project_source_root() / python_test_libraries_path,
meson.current_source_dir())
install_data(
files(
lib_path / 'taptestrunner.py',
lib_path / 'testprogramrunner.py',
),
install_dir: installed_tests_execdir,
install_tag: 'tests',
)
endif
subdir('lib')