[Mesa-dev] [PATCH 1/4] glsl/tests/optimisation-test: make sure that $PYTHON2 is set/available

Emil Velikov emil.l.velikov at gmail.com
Fri Feb 24 16:51:08 UTC 2017


On 24 February 2017 at 15:34, Eric Engestrom <eric.engestrom at imgtec.com> wrote:
> On Thursday, 2017-02-23 16:43:07 +0000, Emil Velikov wrote:
>> From: Emil Velikov <emil.velikov at collabora.com>
>>
>> Otherwise we'll fail when invoking the script outside of "make check"
>>
>> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
>> ---
>>  src/compiler/glsl/tests/optimization-test | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/src/compiler/glsl/tests/optimization-test b/src/compiler/glsl/tests/optimization-test
>> index 26a51be698..7ccbb4467d 100755
>> --- a/src/compiler/glsl/tests/optimization-test
>> +++ b/src/compiler/glsl/tests/optimization-test
>> @@ -6,6 +6,16 @@ else
>>     compare_ir=./compare_ir
>>  fi
>>
>> +if [ -z "$PYTHON2" ]; then
>> +    PYTHON2=python2
>> +fi
>> +
>> +which $PYTHON2 >/dev/null
>> +if [ "x$?" != x0 ]; then
>
> You want a numerical comparison here (`[ $? -ne 0 ]`), not a string
> comparison, and you could also simplify it as:
>         if ! which $PYTHON2 >/dev/null; then
Similar hunk in src/Makefile.am did fail on zsh, so I opted for the split here.
Need to track down exact reason behind it, but the series became quite
large even w/o it ;-)

Barring strong preference on the last suggestion I'll stick with -ne 0.

Thanks
Emil


More information about the mesa-dev mailing list