From: DaanDeMeyer Date: Mon, 14 Jul 2025 09:54:00 +0000 (+0200) Subject: meson: Fix missing test dependencies X-Git-Tag: v258-rc1~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=140850531877aad2401c7f83e60a3a2eac687883;p=thirdparty%2Fsystemd.git meson: Fix missing test dependencies These test would fail when executed directly with meson test before doing a build because the required dependencies are not declared, let's fix that. --- diff --git a/src/boot/meson.build b/src/boot/meson.build index 68f1432d1dc..7cb500fac08 100644 --- a/src/boot/meson.build +++ b/src/boot/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later efi_config_h_dir = meson.current_build_dir() -efi_addon = '' +efi_addon = [] libefitest = static_library( 'efitest', @@ -466,12 +466,12 @@ foreach efi_elf_binary : efi_elf_binaries # This is supposed to match exactly one time if name == 'addon@0@.efi.stub'.format(efi_arch) - efi_addon = exe.full_path() + efi_addon = [exe] endif test('check-alignment-@0@'.format(name), check_efi_alignment_py, - args : exe.full_path(), + args : exe, suite : 'boot') endforeach diff --git a/src/rpm/meson.build b/src/rpm/meson.build index ffb57bf45d4..a2bbd969503 100644 --- a/src/rpm/meson.build +++ b/src/rpm/meson.build @@ -12,9 +12,11 @@ in_files = [ # The last two don't get installed anywhere, one of them needs to included in # the rpm spec file definition instead. +rpm_depends = [] + foreach tuple : in_files file = tuple[0] - custom_target( + rpm_depends += custom_target( input : file + '.in', output : file, command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'], diff --git a/src/test/meson.build b/src/test/meson.build index 87e54d2b05f..111fe541ba9 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -11,17 +11,14 @@ test_hashmap_ordered_c = custom_target( generated_sources += test_hashmap_ordered_c path = run_command(sh, '-c', 'echo "$PATH"', check: true).stdout().strip() -test_env = environment() +test_env = { + 'PATH' : meson.project_build_root() + ':' + path, + 'PROJECT_BUILD_ROOT' : meson.project_build_root(), + 'SYSTEMD_SLOW_TESTS' : want_slow_tests ? '1' : '0', + 'PYTHONDONTWRITEBYTECODE' : '1', +} if conf.get('ENABLE_LOCALED') == 1 - test_env.set('SYSTEMD_LANGUAGE_FALLBACK_MAP', language_fallback_map) -endif -test_env.set('PATH', meson.project_build_root() + ':' + path) -test_env.set('PROJECT_BUILD_ROOT', meson.project_build_root()) -test_env.set('SYSTEMD_SLOW_TESTS', want_slow_tests ? '1' : '0') -test_env.set('PYTHONDONTWRITEBYTECODE', '1') - -if efi_addon != '' - test_env.set('EFI_ADDON', efi_addon) + test_env += {'SYSTEMD_LANGUAGE_FALLBACK_MAP' : language_fallback_map} endif ############################################################ diff --git a/src/ukify/test/meson.build b/src/ukify/test/meson.build index 2df196b4775..68be54e2282 100644 --- a/src/ukify/test/meson.build +++ b/src/ukify/test/meson.build @@ -15,7 +15,8 @@ if want_ukify and want_tests != 'false' test('test-ukify', files('test_ukify.py'), args: args, - env : test_env, + env : test_env + {'EFI_ADDON' : efi_addon.length() > 0 ? efi_addon[0].full_path() : ''}, timeout : 120, - suite : 'ukify') + suite : 'ukify', + depends : efi_addon) endif diff --git a/test/meson.build b/test/meson.build index 9149ca1e1e8..cd5f747c9fe 100644 --- a/test/meson.build +++ b/test/meson.build @@ -220,7 +220,8 @@ if rpm.found() and rpmspec.found() test('test-rpm-macros', test_rpm_macros, suite : 'dist', - args : [meson.project_build_root()]) + args : [meson.project_build_root()], + depends : rpm_depends) endif else message('Skipping test-rpm-macros since rpm and/or rpmspec are not available')