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.
master
Dylan Baker 2022-07-29 10:48:05 -07:00
parent 06fe2e23b0
commit c04097e491
2 changed files with 4 additions and 5 deletions

View File

@ -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

View File

@ -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