From c04097e4913bac46aa6fcc7095255b671ac67bac Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 29 Jul 2022 10:48:05 -0700 Subject: [PATCH] meson: pass configured files idiomatically Instead of attempting to figure out what the paths will be, take the returned file object and pass that around, meson will then automatically figure out the correct paths. --- meson.build | 5 ++--- tests/meson.build | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 161c5ef..b77ee85 100644 --- a/meson.build +++ b/meson.build @@ -119,9 +119,8 @@ pkgconf_exe = executable('pkgconf', if get_option('tests') kyua_exe = find_program('kyua') atf_sh_exe = find_program('atf-sh') - test('kyua', kyua_exe, args : ['--config=none', 'test', '--kyuafile=' + join_paths(meson.current_build_dir(), 'Kyuafile'), '--build-root=' + meson.current_build_dir()]) - - configure_file(input : 'Kyuafile.in', output : 'Kyuafile', configuration : cdata) + 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 diff --git a/tests/meson.build b/tests/meson.build index beaf393..d68096b 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -18,6 +18,6 @@ tests = [ # yuck foreach test : tests - configure_file(input: test + '.sh', output: test, copy: true) - run_command('chmod', '755', join_paths(meson.current_build_dir(), 'tests', test)) + test_file = configure_file(input: test + '.sh', output: test, copy: true) + run_command('chmod', '755', test_file) endforeach