Quoting Emil Velikov (2018-08-17 04:11:32) > From: Dylan Baker <[email protected]> > > There are multiple reasons why the python scripts are executed > explicitly via $PYTHON or equivalent. In random order: > > - env is rarely a thing on Windows
windows does something completely different based on file extensions, however
IUC, the python loader for windows does actually read the shbang to decide
whether to invoke python 2 or python 3, so that might not be a problem
> - env can be outside of /usr/bin/
Ah Haiku. :)
> - the python executable varies across platforms - pythonX.Y, python
> - we want to use the same python version everywhere in Mesa
> - executing the scripts manually, doesn't ensure all the dependencies
> are built and up-to date
This is not true for meson, meson runs tests all at once after all
building/re-building is complete.
> - last but not least - it hinders python 2/3 compatibility
>
> Fixes: 877d250ea14 ("meson: enable optimization-test")
> Fixes: ad9c2f20181 ("meson: run glsl compiler warnings test")
> Cc: Dylan Baker <[email protected]>
> Reviewed-by: Emil Velikov <[email protected]>
> [Emil: commit message, fixes tags, add glcpp test]
> Signed-off-by: Emil Velikov <[email protected]>
> ---
> Dylan,
>
> I _may_ have gone overboard with the list above. Dropping to 1-2 is
> perfectly fine - let me know if your preference.
>
> Either way, lets drop the execute bit/shebang. Running the scripts
> manually is cool, but not something anyone should do.
> ---
> src/compiler/glsl/glcpp/meson.build | 3 ++-
> src/compiler/glsl/tests/meson.build | 11 ++++++++---
> 2 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/src/compiler/glsl/glcpp/meson.build
> b/src/compiler/glsl/glcpp/meson.build
> index 09d44ddd687..769406f5331 100644
> --- a/src/compiler/glsl/glcpp/meson.build
> +++ b/src/compiler/glsl/glcpp/meson.build
> @@ -64,8 +64,9 @@ if with_tests
> foreach m : modes
> test(
> 'glcpp test (@0@)'.format(m),
> - find_program('tests/glcpp_test.py'),
> + prog_python,
> args : [
> + join_paths(meson.current_source_dir(), 'tests/glcpp_test.py'),
> glcpp, join_paths(meson.current_source_dir(), 'tests'),
> '--@0@'.format(m),
> ],
> diff --git a/src/compiler/glsl/tests/meson.build
> b/src/compiler/glsl/tests/meson.build
> index fc7b863a278..2a41e30a28d 100644
> --- a/src/compiler/glsl/tests/meson.build
> +++ b/src/compiler/glsl/tests/meson.build
> @@ -84,8 +84,10 @@ test(
> )
>
> test(
> - 'glsl compiler warnings', find_program('warnings_test.py'),
> + 'glsl compiler warnings',
> + prog_python,
> args : [
> + join_paths(meson.current_source_dir(), 'warnings_test.py'),
> '--glsl-compiler', glsl_compiler,
> '--test-directory', join_paths(
> meson.source_root(), 'src', 'compiler', 'glsl', 'tests', 'warnings'
> @@ -94,6 +96,9 @@ test(
> )
> test(
> 'glsl optimization',
> - find_program('optimization_test.py'),
> - args : ['--test-runner', glsl_test],
> + prog_python,
> + args : [
> + join_paths(meson.current_source_dir(), 'optimization_test.py'),
> + '--test-runner', glsl_test
> + ],
> )
> --
> 2.18.0
>
signature.asc
Description: signature
_______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
