[Mesa-dev] [PATCH] glsl: Use more portable bash invocation construct.

Ian Romanick idr at freedesktop.org
Wed Nov 20 11:29:54 PST 2013


On 11/19/2013 11:26 PM, Vinson Lee wrote:
> Fixes 'make check' on distros where bash is not at /bin/bash.
> 
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Tested-by: Ian Romanick <ian.d.romanick at intel.com>

I just tested it on plain ol' Linux, and it didn't break.

> ---
>  src/glsl/tests/lower_jumps/create_test_cases.py                         | 2 +-
>  src/glsl/tests/lower_jumps/lower_breaks_1.opt_test                      | 2 +-
>  src/glsl/tests/lower_jumps/lower_breaks_2.opt_test                      | 2 +-
>  src/glsl/tests/lower_jumps/lower_breaks_3.opt_test                      | 2 +-
>  src/glsl/tests/lower_jumps/lower_breaks_4.opt_test                      | 2 +-
>  src/glsl/tests/lower_jumps/lower_breaks_5.opt_test                      | 2 +-
>  src/glsl/tests/lower_jumps/lower_breaks_6.opt_test                      | 2 +-
>  src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test     | 2 +-
>  src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test               | 2 +-
>  src/glsl/tests/lower_jumps/lower_returns_1.opt_test                     | 2 +-
>  src/glsl/tests/lower_jumps/lower_returns_2.opt_test                     | 2 +-
>  src/glsl/tests/lower_jumps/lower_returns_3.opt_test                     | 2 +-
>  src/glsl/tests/lower_jumps/lower_returns_4.opt_test                     | 2 +-
>  src/glsl/tests/lower_jumps/lower_returns_main_false.opt_test            | 2 +-
>  src/glsl/tests/lower_jumps/lower_returns_main_true.opt_test             | 2 +-
>  src/glsl/tests/lower_jumps/lower_returns_sub_false.opt_test             | 2 +-
>  src/glsl/tests/lower_jumps/lower_returns_sub_true.opt_test              | 2 +-
>  src/glsl/tests/lower_jumps/lower_unified_returns.opt_test               | 2 +-
>  src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test      | 2 +-
>  .../lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test   | 2 +-
>  .../lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test    | 2 +-
>  .../return_non_void_at_end_of_loop_lower_return_and_break.opt_test      | 2 +-
>  .../tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test | 2 +-
>  .../tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test  | 2 +-
>  .../return_void_at_end_of_loop_lower_return_and_break.opt_test          | 2 +-
>  src/glsl/tests/optimization-test                                        | 2 +-
>  26 files changed, 26 insertions(+), 26 deletions(-)
> 
> diff --git a/src/glsl/tests/lower_jumps/create_test_cases.py b/src/glsl/tests/lower_jumps/create_test_cases.py
> index fbc6f0a..9974681 100644
> --- a/src/glsl/tests/lower_jumps/create_test_cases.py
> +++ b/src/glsl/tests/lower_jumps/create_test_cases.py
> @@ -291,7 +291,7 @@ def create_test_case(doc_string, input_sexp, expected_sexp, test_name,
>      args = ['../../glsl_test', 'optpass', '--quiet', '--input-ir', optimization]
>      test_file = '{0}.opt_test'.format(test_name)
>      with open(test_file, 'w') as f:
> -        f.write('#!/bin/bash\n#\n# This file was generated by create_test_cases.py.\n#\n')
> +        f.write('#!/usr/bin/env bash\n#\n# This file was generated by create_test_cases.py.\n#\n')
>          f.write(doc_string)
>          f.write('{0} <<EOF\n'.format(bash_quote(*args)))
>          f.write('{0}\nEOF\n'.format(input_str))
> diff --git a/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test b/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test
> index 01ad708..dc9cf8f 100755
> --- a/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test b/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test
> index 0be22f9..9b297da 100755
> --- a/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test b/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test
> index 4149360..366e230 100755
> --- a/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test b/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test
> index 70458bb..350ad62 100755
> --- a/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test b/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test
> index da9eef1..72b2072 100755
> --- a/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test b/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test
> index 9440dfe..711ab87 100755
> --- a/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test b/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test
> index 379aa59..a633069 100755
> --- a/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test b/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test
> index 15f3c41..eeae6fd 100755
> --- a/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_returns_1.opt_test b/src/glsl/tests/lower_jumps/lower_returns_1.opt_test
> index a1f895b..e73c512 100755
> --- a/src/glsl/tests/lower_jumps/lower_returns_1.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_returns_1.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_returns_2.opt_test b/src/glsl/tests/lower_jumps/lower_returns_2.opt_test
> index 61673d4..da2dc7e 100755
> --- a/src/glsl/tests/lower_jumps/lower_returns_2.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_returns_2.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_returns_3.opt_test b/src/glsl/tests/lower_jumps/lower_returns_3.opt_test
> index 9881e24..9509781 100755
> --- a/src/glsl/tests/lower_jumps/lower_returns_3.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_returns_3.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_returns_4.opt_test b/src/glsl/tests/lower_jumps/lower_returns_4.opt_test
> index 9f54c67..c5bb9c8 100755
> --- a/src/glsl/tests/lower_jumps/lower_returns_4.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_returns_4.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_returns_main_false.opt_test b/src/glsl/tests/lower_jumps/lower_returns_main_false.opt_test
> index 5f97bfd..fdb1d0e 100755
> --- a/src/glsl/tests/lower_jumps/lower_returns_main_false.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_returns_main_false.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_returns_main_true.opt_test b/src/glsl/tests/lower_jumps/lower_returns_main_true.opt_test
> index 59c7ba1..939ec8b 100755
> --- a/src/glsl/tests/lower_jumps/lower_returns_main_true.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_returns_main_true.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_returns_sub_false.opt_test b/src/glsl/tests/lower_jumps/lower_returns_sub_false.opt_test
> index 40e784e..92a4e8a 100755
> --- a/src/glsl/tests/lower_jumps/lower_returns_sub_false.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_returns_sub_false.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_returns_sub_true.opt_test b/src/glsl/tests/lower_jumps/lower_returns_sub_true.opt_test
> index 9fe6b90..789414e 100755
> --- a/src/glsl/tests/lower_jumps/lower_returns_sub_true.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_returns_sub_true.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/lower_unified_returns.opt_test b/src/glsl/tests/lower_jumps/lower_unified_returns.opt_test
> index e716813..5d6e51c 100755
> --- a/src/glsl/tests/lower_jumps/lower_unified_returns.opt_test
> +++ b/src/glsl/tests/lower_jumps/lower_unified_returns.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test b/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test
> index 18efc37..ceb010c 100755
> --- a/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test
> +++ b/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test
> index 79c0e82..a93167b 100755
> --- a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test
> +++ b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test
> index 920d2ad..9ce33f0 100755
> --- a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test
> +++ b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test
> index 99f1f86..06988c2 100755
> --- a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test
> +++ b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test
> index 63487d3..45699a8 100755
> --- a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test
> +++ b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test
> index 523c92a..abfa582 100755
> --- a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test
> +++ b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test
> index 22b5581..a8c5e37 100755
> --- a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test
> +++ b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  #
>  # This file was generated by create_test_cases.py.
>  #
> diff --git a/src/glsl/tests/optimization-test b/src/glsl/tests/optimization-test
> index 59383f8..8ca7776 100755
> --- a/src/glsl/tests/optimization-test
> +++ b/src/glsl/tests/optimization-test
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  if [ ! -z "$srcdir" ]; then
>     compare_ir=`pwd`/tests/compare_ir
> 



More information about the mesa-dev mailing list