From 1cd84fec982eb0ff6aa9c600537e1c793ef9b48b Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 26 Aug 2022 10:03:49 -0700 Subject: [PATCH] meson: fix tests on windows The tests call chmod unconditionally, which is obviously problematic on Windows. I have an idea for a more robust fix in Meson, but in the mean time we can avoid the problem by not going into the test directory if kyua and atf_sh aren't found or are disabled. --- meson.build | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 0d42d42..161f37d 100644 --- a/meson.build +++ b/meson.build @@ -120,9 +120,11 @@ pkgconf_exe = executable('pkgconf', with_tests = get_option('tests') kyua_exe = find_program('kyua', required : with_tests, disabler : true) atf_sh_exe = find_program('atf-sh', required : with_tests, disabler : true) -kyuafile = configure_file(input : 'Kyuafile.in', output : 'Kyuafile', configuration : cdata) -test('kyua', kyua_exe, args : ['--config=none', 'test', '--kyuafile', kyuafile, '--build-root', meson.current_build_dir()]) -subdir('tests') +if kyua_exe.found() and atf_sh_exe.found() + kyuafile = configure_file(input : 'Kyuafile.in', output : 'Kyuafile', configuration : cdata) + test('kyua', kyua_exe, args : ['--config=none', 'test', '--kyuafile', kyuafile, '--build-root', meson.current_build_dir()]) + subdir('tests') +endif install_man('man/pkgconf.1') install_man('man/pkg.m4.7') -- 2.41.0