[1/2] sanity: Turn shader_test list into a string

Submitted by Jordan Justen on Sept. 21, 2018, 10:53 p.m.

Details

Message ID 20180921225347.20411-1-jordan.l.justen@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Jordan Justen Sept. 21, 2018, 10:53 p.m.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
---
 tests/sanity.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/sanity.py b/tests/sanity.py
index 88bf27457..566d63218 100644
--- a/tests/sanity.py
+++ b/tests/sanity.py
@@ -66,10 +66,15 @@  def add_shader_test(shader):
 
 profile = TestProfile()
 
-add_shader_test('tests/shaders/glsl-algebraic-add-zero.shader_test')
-add_shader_test('tests/spec/glsl-1.50/execution/geometry-basic.shader_test')
-add_shader_test('tests/spec/arb_tessellation_shader/execution/sanity.shader_test')
-add_shader_test('tests/spec/arb_compute_shader/execution/basic-ssbo.shader_test')
+shader_tests = '''
+tests/shaders/glsl-algebraic-add-zero.shader_test
+tests/spec/arb_compute_shader/execution/basic-ssbo.shader_test
+tests/spec/arb_tessellation_shader/execution/sanity.shader_test
+tests/spec/glsl-1.50/execution/geometry-basic.shader_test
+'''
+
+for line in shader_tests.split():
+    add_shader_test(line)
 
 with profile.test_list.group_manager(
         PiglitGLTest,

Comments

On Fri, Sep 21, 2018 at 03:53:46PM -0700, Jordan Justen wrote:
> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
> ---
>  tests/sanity.py | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Quoting Jordan Justen (2018-09-21 15:53:46)
> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
> ---
>  tests/sanity.py | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/sanity.py b/tests/sanity.py
> index 88bf27457..566d63218 100644
> --- a/tests/sanity.py
> +++ b/tests/sanity.py
> @@ -66,10 +66,15 @@ def add_shader_test(shader):
>  
>  profile = TestProfile()
>  
> -add_shader_test('tests/shaders/glsl-algebraic-add-zero.shader_test')
> -add_shader_test('tests/spec/glsl-1.50/execution/geometry-basic.shader_test')
> -add_shader_test('tests/spec/arb_tessellation_shader/execution/sanity.shader_test')
> -add_shader_test('tests/spec/arb_compute_shader/execution/basic-ssbo.shader_test')
> +shader_tests = '''
> +tests/shaders/glsl-algebraic-add-zero.shader_test
> +tests/spec/arb_compute_shader/execution/basic-ssbo.shader_test
> +tests/spec/arb_tessellation_shader/execution/sanity.shader_test
> +tests/spec/glsl-1.50/execution/geometry-basic.shader_test
> +'''

How about a list of strings?

for that you could have:
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>

> +
> +for line in shader_tests.split():
> +    add_shader_test(line)
>  
>  with profile.test_list.group_manager(
>          PiglitGLTest,
> -- 
> 2.18.0
> 
> _______________________________________________
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
> > -add_shader_test('tests/shaders/glsl-algebraic-add-zero.shader_test')
> > -add_shader_test('tests/spec/glsl-1.50/execution/geometry-basic.shader_test')
> > -add_shader_test('tests/spec/arb_tessellation_shader/execution/sanity.shader_test')
> > -add_shader_test('tests/spec/arb_compute_shader/execution/basic-ssbo.shader_test')
> > +shader_tests = '''
> > +tests/shaders/glsl-algebraic-add-zero.shader_test
> > +tests/spec/arb_compute_shader/execution/basic-ssbo.shader_test
> > +tests/spec/arb_tessellation_shader/execution/sanity.shader_test
> > +tests/spec/glsl-1.50/execution/geometry-basic.shader_test
> > +'''
> 
> How about a list of strings?

One string + split() gives less boilerplate per line. In this case
either should be fine.


Thanks,
Caio
Quoting Caio Marcelo de Oliveira Filho (2018-09-21 16:05:37)
> > > -add_shader_test('tests/shaders/glsl-algebraic-add-zero.shader_test')
> > > -add_shader_test('tests/spec/glsl-1.50/execution/geometry-basic.shader_test')
> > > -add_shader_test('tests/spec/arb_tessellation_shader/execution/sanity.shader_test')
> > > -add_shader_test('tests/spec/arb_compute_shader/execution/basic-ssbo.shader_test')
> > > +shader_tests = '''
> > > +tests/shaders/glsl-algebraic-add-zero.shader_test
> > > +tests/spec/arb_compute_shader/execution/basic-ssbo.shader_test
> > > +tests/spec/arb_tessellation_shader/execution/sanity.shader_test
> > > +tests/spec/glsl-1.50/execution/geometry-basic.shader_test
> > > +'''
> > 
> > How about a list of strings?
> 
> One string + split() gives less boilerplate per line. In this case
> either should be fine.

4 characters per line isn't that much boilerplate; and you're not writing what
you mean as-is. I'm not NAKing, but I still don't like it :)

Dylan