app: (meson) create_test_env.sh was not run.

The script `create_test_env.sh` was registered in meson as a run target
(i.e. to be run manually by `ninja create_test_env`), which is really
not useful. So a `ninja test` was outputting various:

> You have a writable data folder configured (/gimp/build/dir/app/tests/gimpdir-output/gradients),
> but this folder does not exist. Please create the folder or fix your
> configuration in the Preferences dialog's 'Folders' section.

Unfortunately run target are only meant to be run from command lines and
cannot be used in 'depends' argument of test() or 'dependencies' of
executable() because "in Meson all dependencies are to output files, not
to concepts" (cf. https://github.com/mesonbuild/meson/issues/1793).

So instead a run_target() just directly use a run_command() and make
this script run during configuration step. Also make the shell script
executable as it was not.

See also #5666 as it was one of the errors outputted by the reporter's
log (though probably not the main issue).
This commit is contained in:
Jehan 2020-09-20 13:10:39 +02:00
parent 273ff383dd
commit ec26bc44ae
2 changed files with 5 additions and 2 deletions

0
app/tests/create_test_env.sh Normal file → Executable file
View File

View File

@ -44,6 +44,11 @@ app_tests = [
'xcf',
]
cmd = run_command('create_test_env.sh')
if cmd.returncode() != 0
error(cmd.stderr().strip())
endif
foreach test_name : app_tests
test_exe = executable(test_name,
'test-@0@.c'.format(test_name),
@ -64,5 +69,3 @@ foreach test_name : app_tests
)
endforeach
run_target('create_test_env', command: find_program('create_test_env.sh'))