[Mesa-dev] [PATCH 1/4] glsl: remove execute bit/shebang from glcpp_test.py

Dylan Baker dylan at pnwbakers.com
Tue Apr 24 18:20:25 UTC 2018


Quoting Emil Velikov (2018-04-24 10:49:19)
> From: Emil Velikov <emil.velikov at collabora.com>
> 
> Mesa explicitly manages the invocation of all python scripts.
> Do so here, by removing the shebang line alongside the execute bit of
> the newly introduced script.
> 
> Fixes: db8cd8e36771 ("glcpp/tests: Convert shell scripts to a python
> script")
> Cc: Dylan Baker <dylan at pnwbakers.com>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> Suspecting that meson should be updated to use prog_python2, just not
> too sure how to handle that. Is using a custom_target() a wise move for
> tests?

You can't use custom_target() for tests, they have to be called via test().

> ---
>  src/compiler/glsl/glcpp/tests/glcpp_test.py | 1 -
>  1 file changed, 1 deletion(-)
>  mode change 100755 => 100644 src/compiler/glsl/glcpp/tests/glcpp_test.py
> 
> diff --git a/src/compiler/glsl/glcpp/tests/glcpp_test.py b/src/compiler/glsl/glcpp/tests/glcpp_test.py
> old mode 100755
> new mode 100644
> index cdc63b3ac2..751bd40028
> --- a/src/compiler/glsl/glcpp/tests/glcpp_test.py
> +++ b/src/compiler/glsl/glcpp/tests/glcpp_test.py
> @@ -1,4 +1,3 @@
> -#!/usr/bin/env python2

No, this is how meson determines what program to use to run the exectuable. This
needs to be left alone. You'll either need to add a bunch of messy code to
meson to run this, or just leave this alone. It's really not hurting anything.

For build scripts I agree with your logic 100%, no one needs to be calling
those manually. For tests though it makes sense to me for a developer to be able
to call the offending test themselves, in case they want too look at one test at
a time, for example.

When I developed these I developed them by calling them manually, not by
invoking ninja test.

Dylan

>  # encoding=utf-8
>  # Copyright © 2018 Intel Corporation
>  
> -- 
> 2.16.0
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180424/442bad98/attachment.sig>


More information about the mesa-dev mailing list