[gimp] app: (meson) create_test_env.sh was not run.



commit ec26bc44ae019b289f44e4f6a9cf0b6d2710ff98
Author: Jehan <jehan girinstud io>
Date:   Sun Sep 20 13:10:39 2020 +0200

    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).

 app/tests/create_test_env.sh | 0
 app/tests/meson.build        | 7 +++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/app/tests/create_test_env.sh b/app/tests/create_test_env.sh
old mode 100644
new mode 100755
diff --git a/app/tests/meson.build b/app/tests/meson.build
index 2900e061b4..abf61c975a 100644
--- a/app/tests/meson.build
+++ b/app/tests/meson.build
@@ -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'))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]