From f16e064fd9454fb8f754b769ad1ffce0e42b51db Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 27 Mar 2024 15:34:50 +0000 Subject: [PATCH] tests: Make sure FUSERMOUNT gets set for "as-installed" tests Otherwise, tests for OCI and the update portal fail with: /usr/libexec/installed-tests/Flatpak/libtest.sh: line 611: FUSERMOUNT: unbound variable Fixes: 2cb17b4e "Do not hard-code fusermount, add option or auto-detect instead" Signed-off-by: Simon McVittie --- tests/installed-tests.sh.in | 4 ++++ tests/libtest.sh | 4 ++++ tests/meson.build | 11 +++++++++++ 3 files changed, 19 insertions(+) create mode 100644 tests/installed-tests.sh.in diff --git a/tests/installed-tests.sh.in b/tests/installed-tests.sh.in new file mode 100644 index 00000000..e0978ec4 --- /dev/null +++ b/tests/installed-tests.sh.in @@ -0,0 +1,4 @@ +# Copyright 2024 Collabora Ltd. +# SPDX-License-Identifier: LGPL-2.1-or-later + +FUSERMOUNT='@FUSERMOUNT@' diff --git a/tests/libtest.sh b/tests/libtest.sh index c4a403f5..b29ba555 100644 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -38,6 +38,10 @@ else test_builddir=$(dirname $0) fi +if [ -e "$test_srcdir/installed-tests.sh" ]; then + . "$test_srcdir/installed-tests.sh" +fi + # All the asserts and ok functions below are wrapped such that they # don't output any set -x traces of their internals (but still echo # errors to stderr). This way the log output focuses on tracing what diff --git a/tests/meson.build b/tests/meson.build index db42c8a9..07606e35 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -40,6 +40,17 @@ else tests_environment.set('FLATPAK_DBUSPROXY', get_option('system_dbus_proxy')) endif +if get_option('installed_tests') + configure_file( + input : 'installed-tests.sh.in', + output : 'installed-tests.sh', + configuration : { + 'FUSERMOUNT' : fusermount, + }, + install_dir : installed_testdir, + ) +endif + # Explicitly doing a find_program() for this avoids lots of output with # older Meson versions tap_test = find_program(