Skip to content
Snippets Groups Projects
Commit d370f2f2 authored by Ludovico de Nittis's avatar Ludovico de Nittis :palm_tree:
Browse files

tests: Generate mock sysroots programmatically


The python import fix has been taken from pressure-vessel.

Signed-off-by: default avatarLudovico de Nittis <ludovico.denittis@collabora.com>
parent a226e79c
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !115. Comments created here will be created in the context of that merge request.
Showing
with 31 additions and 24 deletions
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
/build/ /build/
/builddir/ /builddir/
/obj-*/ /obj-*/
/tests/sysroots/
...@@ -40,6 +40,15 @@ abi_minor = '20200331.1' ...@@ -40,6 +40,15 @@ abi_minor = '20200331.1'
pkg = import('pkgconfig') pkg = import('pkgconfig')
gnome = import('gnome') gnome = import('gnome')
# We'd like to use import('python').find_installation(), but before
# Meson 0.50 there was a bug where it didn't have a path() method,
# making it useless to us here.
if get_option('python') == ''
python = find_program('python3.5', 'python3', required : true)
else
python = find_program(get_option('python'), required : true)
endif
if get_option('man') if get_option('man')
pandoc = find_program('pandoc', required : true) pandoc = find_program('pandoc', required : true)
......
...@@ -32,3 +32,11 @@ option( ...@@ -32,3 +32,11 @@ option(
value : '', value : '',
description : 'Debian-style multiarch tuple', description : 'Debian-style multiarch tuple',
) )
option(
'python',
type : 'string',
value : '',
description: 'Search for this Python instead of "python3.5" and "python3"'
)
...@@ -61,12 +61,19 @@ install_subdir('expectations_with_missings', install_dir : tests_dir) ...@@ -61,12 +61,19 @@ install_subdir('expectations_with_missings', install_dir : tests_dir)
# Vulkan *.json files. (The order of EGL *.json files is well-defined.) # Vulkan *.json files. (The order of EGL *.json files is well-defined.)
install_subdir('fake-icds', install_dir : tests_dir) install_subdir('fake-icds', install_dir : tests_dir)
install_subdir('fake-steam-runtime', install_dir : tests_dir) install_subdir('fake-steam-runtime', install_dir : tests_dir)
# Instead of doing `install_subdir` for "sysroot" we use a custom install
# script because with `install_subdir` the symlinks don't get preserved, meson.add_postconf_script(
# but instead they are copied as files. And this behavior breaks our tests. python.path(),
src = meson.current_source_dir() + '/' + 'sysroots' join_paths(meson.source_root(), 'tests', 'generate-sysroots.py'),
# Note that the `-a` option is Linux specific join_paths(meson.source_root(), 'tests', 'sysroots'),
meson.add_install_script('sh', '-c', 'cp -a "$1" "${DESTDIR}/${MESON_INSTALL_PREFIX}/$2"', 'sh', src, tests_dir) )
meson.add_install_script(
python.path(),
join_paths(meson.source_root(), 'tests', 'generate-sysroots.py'),
'--install',
join_paths(tests_dir, 'sysroots'),
)
# These are all the same: they just exit 0. # These are all the same: they just exit 0.
foreach helper : [ foreach helper : [
......
PRETTY_NAME="Debian GNU/Linux bullseye/sid"
NAME="Debian GNU/Linux"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
whatever
libvdpau_radeonsi.so.1.0.0
\ No newline at end of file
libvdpau_radeonsi.so.1.0.0
\ No newline at end of file
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment