Re: [Piglit] [PATCH 4/4] program_interface_query: add tests for getprogramresourcename

2015-03-26 Thread Tapani Pälli

Hi;

starting with the shortest .. :)

I have one addition to the test, after linking try out giving NULL for 
the name field:


glGetProgramResourceName(prog, GL_UNIFORM, pos, 0, length, NULL);


With this addition;
Reviewed-by: Tapani Pälli tapani.pa...@intel.com


On 03/25/2015 06:01 PM, Martin Peres wrote:

Tests the error paths of GetProgramResourceName

Signed-off-by: Martin Peres martin.pe...@linux.intel.com
---
  tests/all.py   |   1 +
  .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
  .../getprogramresourcename.c   | 177 +
  3 files changed, 179 insertions(+)
  create mode 100755 
tests/spec/arb_program_interface_query/getprogramresourcename.c

diff --git a/tests/all.py b/tests/all.py
index 170d5b8..d0b4b09 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2276,6 +2276,7 @@ with profile.group_manager(
  g(['arb_program_interface_query-resource-query'], run_concurrent=False)
  g(['arb_program_interface_query-getprograminterfaceiv'], 
run_concurrent=False)
  g(['arb_program_interface_query-getprogramresourceindex'], 
run_concurrent=False)
+g(['arb_program_interface_query-getprogramresourcename'], 
run_concurrent=False)

  # Group ARB_explicit_uniform_location
  with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 8b3bbd9..2508342 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -13,3 +13,4 @@ piglit_add_executable 
(arb_program_interface_query-resource-location resource-lo
  piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
  piglit_add_executable (arb_program_interface_query-getprograminterfaceiv 
getprograminterfaceiv.c)
  piglit_add_executable (arb_program_interface_query-getprogramresourceindex 
getprogramresourceindex.c)
+piglit_add_executable (arb_program_interface_query-getprogramresourcename 
getprogramresourcename.c)
diff --git a/tests/spec/arb_program_interface_query/getprogramresourcename.c 
b/tests/spec/arb_program_interface_query/getprogramresourcename.c
new file mode 100755
index 000..9db705e
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprogramresourcename.c
@@ -0,0 +1,177 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file getprogramresourcename.c
+ *
+ * Tests the error cases of the GetProgramResourceName interface. The real
+ * functional test is resource-query.
+ *
+ * From the GL_ARB_program_interface_query spec:
+ *  The command
+ *
+ *  void GetProgramResourceName(uint program, enum programInterface,
+ *  uint index, sizei bufSize, sizei *length,
+ *  char *name);
+ *
+ *  returns the name string assigned to the single active resource with an
+ *  index of index in the interface programInterface of program object
+ *  program.  The error INVALID_VALUE is generated if index is greater
+ *  than or equal to the number of entries in the active resource list for
+ *  programInterface.  The error INVALID_ENUM is generated if
+ *  programInterface is ATOMIC_COUNTER_BUFFER, since active atomic 
counter
+ *  buffer resources are not assigned name strings.
+ *
+ *  The name string assigned to the active resource identified by index 
is
+ *  returned as a null-terminated string in name.  The actual number of
+ *  characters written into name, excluding the null terminator, is
+ *  returned in length.  If length is NULL, no length is returned. The
+ *  maximum number of characters that may be written into name, including
+ *  the null terminator, is specified by bufSize.  If the length of the
+ *  

Re: [Piglit] [PATCH 4/4] program_interface_query: add tests for getprogramresourcename

2015-03-26 Thread Tapani Pälli



On 03/26/2015 10:58 AM, Martin Peres wrote:



On 26/03/15 10:45, Tapani Pälli wrote:

Hi;

starting with the shortest .. :)

I have one addition to the test, after linking try out giving NULL for
the name field:

glGetProgramResourceName(prog, GL_UNIFORM, pos, 0, length, NULL);


This is not really in the spec, hence why I did not add it. Pointers
should always be valid.


Yeah I tried to search for 'general null check/error' from specs but it 
does not seem to exist, it's a bit extra checking but for robustness 
sake it's good to have.



Anyway, better catch a bad implementation so I added it:

diff --git
a/tests/spec/arb_program_interface_query/getprogramresourcename.c
b/tests/spec/arb_program_interface_query/getprogramresourcename.c
index 9db705e..7dc3195 100755
--- a/tests/spec/arb_program_interface_query/getprogramresourcename.c
+++ b/tests/spec/arb_program_interface_query/getprogramresourcename.c
@@ -155,6 +155,12 @@ piglit_display(void)
 piglit_report_subtest_result(local ? PIGLIT_PASS : PIGLIT_FAIL,
  size == 0);

+   glGetProgramResourceName(prog, GL_UNIFORM, pos, 0, length, NULL);
+   local = piglit_check_gl_error(GL_NO_ERROR);
+   pass = pass  local;
+   piglit_report_subtest_result(local ? PIGLIT_PASS : PIGLIT_FAIL,
+NULL name);
+
 if
(piglit_is_extension_supported(GL_ARB_shader_atomic_counters)) {
 glGetProgramResourceName(prog,
GL_ATOMIC_COUNTER_BUFFER, 0,
  100, length, name);




With this addition;
Reviewed-by: Tapani Pälli tapani.pa...@intel.com


Added too, thanks.



On 03/25/2015 06:01 PM, Martin Peres wrote:

Tests the error paths of GetProgramResourceName

Signed-off-by: Martin Peres martin.pe...@linux.intel.com
---
  tests/all.py   |   1 +
  .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
  .../getprogramresourcename.c   | 177
+
  3 files changed, 179 insertions(+)
  create mode 100755
tests/spec/arb_program_interface_query/getprogramresourcename.c

diff --git a/tests/all.py b/tests/all.py
index 170d5b8..d0b4b09 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2276,6 +2276,7 @@ with profile.group_manager(
  g(['arb_program_interface_query-resource-query'],
run_concurrent=False)
  g(['arb_program_interface_query-getprograminterfaceiv'],
run_concurrent=False)
  g(['arb_program_interface_query-getprogramresourceindex'],
run_concurrent=False)
+g(['arb_program_interface_query-getprogramresourcename'],
run_concurrent=False)

  # Group ARB_explicit_uniform_location
  with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 8b3bbd9..2508342 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -13,3 +13,4 @@ piglit_add_executable
(arb_program_interface_query-resource-location resource-lo
  piglit_add_executable (arb_program_interface_query-resource-query
resource-query.c)
  piglit_add_executable
(arb_program_interface_query-getprograminterfaceiv
getprograminterfaceiv.c)
  piglit_add_executable
(arb_program_interface_query-getprogramresourceindex
getprogramresourceindex.c)
+piglit_add_executable
(arb_program_interface_query-getprogramresourcename
getprogramresourcename.c)
diff --git
a/tests/spec/arb_program_interface_query/getprogramresourcename.c
b/tests/spec/arb_program_interface_query/getprogramresourcename.c
new file mode 100755
index 000..9db705e
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprogramresourcename.c
@@ -0,0 +1,177 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person
obtaining a
+ * copy of this software and associated documentation files (the
Software),
+ * to deal in the Software without restriction, including without
limitation
+ * the rights to use, copy, modify, merge, publish, distribute,
sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom
the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including
the next
+ * paragraph) shall be included in all copies or substantial
portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO
EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file 

Re: [Piglit] [PATCH 3/4] program_interface_query: add tests for getprogramresourceindex

2015-03-26 Thread Tapani Pälli



On 03/25/2015 06:01 PM, Martin Peres wrote:

Tests tricky cases of resource naming along with some error cases of
getprogramresourceindex. It also replaces the resource-index test that
was incomplete and did not consistently report the same number of
subtests depending on errors.

Signed-off-by: Martin Peres martin.pe...@linux.intel.org
---
  tests/all.py   |   2 +-
  .../arb_program_interface_query/CMakeLists.gl.txt  |   2 +-
  tests/spec/arb_program_interface_query/common.h|  21 ++
  .../getprogramresourceindex.c  | 338 +
  .../arb_program_interface_query/resource-index.c   | 284 -
  5 files changed, 361 insertions(+), 286 deletions(-)
  create mode 100755 
tests/spec/arb_program_interface_query/getprogramresourceindex.c
  delete mode 100644 tests/spec/arb_program_interface_query/resource-index.c

diff --git a/tests/all.py b/tests/all.py
index 86f2369..170d5b8 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2273,9 +2273,9 @@ with profile.group_manager(
  PiglitGLTest,
  grouptools.join('spec', 'ARB_program_interface_query')) as g:
  g(['arb_program_interface_query-resource-location'], run_concurrent=False)
-g(['arb_program_interface_query-resource-index'], run_concurrent=False)
  g(['arb_program_interface_query-resource-query'], run_concurrent=False)
  g(['arb_program_interface_query-getprograminterfaceiv'], 
run_concurrent=False)
+g(['arb_program_interface_query-getprogramresourceindex'], 
run_concurrent=False)

  # Group ARB_explicit_uniform_location
  with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 91ace72..8b3bbd9 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -10,6 +10,6 @@ link_libraries (
  )

  piglit_add_executable (arb_program_interface_query-resource-location 
resource-location.c)
-piglit_add_executable (arb_program_interface_query-resource-index 
resource-index.c)
  piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
  piglit_add_executable (arb_program_interface_query-getprograminterfaceiv 
getprograminterfaceiv.c)
+piglit_add_executable (arb_program_interface_query-getprogramresourceindex 
getprogramresourceindex.c)
diff --git a/tests/spec/arb_program_interface_query/common.h 
b/tests/spec/arb_program_interface_query/common.h
index cc0b2bd..457e79e 100755
--- a/tests/spec/arb_program_interface_query/common.h
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -35,6 +35,27 @@ static const char fs_empty[] =
void main() {\n
};

+static const char vs_array[] =
+   #version 150\n
+   in vec4 vs_input[2];\n
+   struct vs_struct {\n
+ vec4 hello;\n
+ vec4 world[2];\n
+   };\n
+   uniform vs_struct sa[2];\n
+   void main() {\n
+ gl_Position = vs_input[0] + sa[0].hello + sa[0].world[0];\n
+   };
+
+static const char vs_aofa[] =
+   #version 150\n
+   #extension GL_ARB_arrays_of_arrays : require\n
+   in vec4 vs_input2[2][2];\n
+   in vec4 vs_input3[2][2][2];\n
+   void main() {\n
+ gl_Position = vs_input2[0][0] + vs_input3[0][0][0];\n
+   };
+
  static const char vs_std[] =
#version 150\n
struct vs_struct {\n
diff --git a/tests/spec/arb_program_interface_query/getprogramresourceindex.c 
b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
new file mode 100755
index 000..41aac3d
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
@@ -0,0 +1,338 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file getprogramresourceindex.c
+ *
+ * Tests the errors 

Re: [Piglit] [PATCH 4/4] program_interface_query: add tests for getprogramresourcename

2015-03-26 Thread Martin Peres



On 26/03/15 10:45, Tapani Pälli wrote:

Hi;

starting with the shortest .. :)

I have one addition to the test, after linking try out giving NULL for 
the name field:


glGetProgramResourceName(prog, GL_UNIFORM, pos, 0, length, NULL);


This is not really in the spec, hence why I did not add it. Pointers 
should always be valid.


Anyway, better catch a bad implementation so I added it:

diff --git 
a/tests/spec/arb_program_interface_query/getprogramresourcename.c 
b/tests/spec/arb_program_interface_query/getprogramresourcename.c

index 9db705e..7dc3195 100755
--- a/tests/spec/arb_program_interface_query/getprogramresourcename.c
+++ b/tests/spec/arb_program_interface_query/getprogramresourcename.c
@@ -155,6 +155,12 @@ piglit_display(void)
piglit_report_subtest_result(local ? PIGLIT_PASS : PIGLIT_FAIL,
 size == 0);

+   glGetProgramResourceName(prog, GL_UNIFORM, pos, 0, length, NULL);
+   local = piglit_check_gl_error(GL_NO_ERROR);
+   pass = pass  local;
+   piglit_report_subtest_result(local ? PIGLIT_PASS : PIGLIT_FAIL,
+NULL name);
+
if 
(piglit_is_extension_supported(GL_ARB_shader_atomic_counters)) {

glGetProgramResourceName(prog, GL_ATOMIC_COUNTER_BUFFER, 0,
 100, length, name);




With this addition;
Reviewed-by: Tapani Pälli tapani.pa...@intel.com


Added too, thanks.



On 03/25/2015 06:01 PM, Martin Peres wrote:

Tests the error paths of GetProgramResourceName

Signed-off-by: Martin Peres martin.pe...@linux.intel.com
---
  tests/all.py   |   1 +
  .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
  .../getprogramresourcename.c   | 177 
+

  3 files changed, 179 insertions(+)
  create mode 100755 
tests/spec/arb_program_interface_query/getprogramresourcename.c


diff --git a/tests/all.py b/tests/all.py
index 170d5b8..d0b4b09 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2276,6 +2276,7 @@ with profile.group_manager(
  g(['arb_program_interface_query-resource-query'], 
run_concurrent=False)
  g(['arb_program_interface_query-getprograminterfaceiv'], 
run_concurrent=False)
  g(['arb_program_interface_query-getprogramresourceindex'], 
run_concurrent=False)
+g(['arb_program_interface_query-getprogramresourcename'], 
run_concurrent=False)


  # Group ARB_explicit_uniform_location
  with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt

index 8b3bbd9..2508342 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -13,3 +13,4 @@ piglit_add_executable 
(arb_program_interface_query-resource-location resource-lo
  piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
  piglit_add_executable 
(arb_program_interface_query-getprograminterfaceiv 
getprograminterfaceiv.c)
  piglit_add_executable 
(arb_program_interface_query-getprogramresourceindex 
getprogramresourceindex.c)
+piglit_add_executable 
(arb_program_interface_query-getprogramresourcename 
getprogramresourcename.c)
diff --git 
a/tests/spec/arb_program_interface_query/getprogramresourcename.c 
b/tests/spec/arb_program_interface_query/getprogramresourcename.c

new file mode 100755
index 000..9db705e
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprogramresourcename.c
@@ -0,0 +1,177 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person 
obtaining a
+ * copy of this software and associated documentation files (the 
Software),
+ * to deal in the Software without restriction, including without 
limitation
+ * the rights to use, copy, modify, merge, publish, distribute, 
sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom 
the

+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including 
the next
+ * paragraph) shall be included in all copies or substantial 
portions of the

+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, 
EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO 
EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES 
OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
OTHER DEALINGS

+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file getprogramresourcename.c
+ *
+ * Tests the error cases of the GetProgramResourceName interface. 
The real

+ * functional test is resource-query.
+ *
+ * From the GL_ARB_program_interface_query 

Re: [Piglit] [PATCH 2/4] program_interface_query: add tests for getprograminterfaceiv

2015-03-26 Thread Tapani Pälli
Also with this test we could have the NULL input test, to trigger bad 
things I think it needs to have non-empty shaders though, something like:


glGetProgramInterfaceiv(prog, GL_PROGRAM_OUTPUT, GL_MAX_NAME_LENGTH, NULL);

(some legal query that triggers driver to iterate resources and try to 
write to NULL)


Otherwise all the errors mentioned in the spec are tested, with null 
test addition;


Reviewed-by: Tapani Pälli tapani.pa...@intel.com


On 03/25/2015 06:01 PM, Martin Peres wrote:

This test exercises the error codepaths of getprograminterfaceiv.

Signed-off-by: Martin Peres martin.pe...@linux.intel.com
---
  tests/all.py   |   1 +
  .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
  tests/spec/arb_program_interface_query/common.h|  10 +
  .../getprograminterfaceiv.c| 202 +
  4 files changed, 214 insertions(+)
  create mode 100755 
tests/spec/arb_program_interface_query/getprograminterfaceiv.c

diff --git a/tests/all.py b/tests/all.py
index f47e198..86f2369 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2275,6 +2275,7 @@ with profile.group_manager(
  g(['arb_program_interface_query-resource-location'], run_concurrent=False)
  g(['arb_program_interface_query-resource-index'], run_concurrent=False)
  g(['arb_program_interface_query-resource-query'], run_concurrent=False)
+g(['arb_program_interface_query-getprograminterfaceiv'], 
run_concurrent=False)

  # Group ARB_explicit_uniform_location
  with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 9535798..91ace72 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -12,3 +12,4 @@ link_libraries (
  piglit_add_executable (arb_program_interface_query-resource-location 
resource-location.c)
  piglit_add_executable (arb_program_interface_query-resource-index 
resource-index.c)
  piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
+piglit_add_executable (arb_program_interface_query-getprograminterfaceiv 
getprograminterfaceiv.c)
diff --git a/tests/spec/arb_program_interface_query/common.h 
b/tests/spec/arb_program_interface_query/common.h
index 4e5ff01..cc0b2bd 100755
--- a/tests/spec/arb_program_interface_query/common.h
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -25,6 +25,16 @@
  #ifndef __COMMON_H__
  #define __COMMON_H__

+static const char vs_empty[] =
+   #version 150\n
+   void main() {\n
+   };
+
+static const char fs_empty[] =
+   #version 150\n
+   void main() {\n
+   };
+
  static const char vs_std[] =
#version 150\n
struct vs_struct {\n
diff --git a/tests/spec/arb_program_interface_query/getprograminterfaceiv.c 
b/tests/spec/arb_program_interface_query/getprograminterfaceiv.c
new file mode 100755
index 000..1d2ca08
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprograminterfaceiv.c
@@ -0,0 +1,202 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file getprograminterfaceiv.c
+ *
+ * Tests the error cases of the GetProgramInterfaceiv interface.
+ *
+ * From the GL_ARB_program_interface_query spec:
+ *  The command
+ *
+ *  void GetProgramInterfaceiv(uint program, enum programInterface,
+ * enum pname, int *params);
+ *
+ *  queries a property of the interface programInterface in program
+ *  program, returning its value in params.  The property to return is
+ *  specified by pname.
+ *
+ *  If pname is ACTIVE_RESOURCES, the value returned is the number of
+ *  resources in the active resource list for programInterface. If the
+ *  list of active resources for 

Re: [Piglit] [PATCH 3/4] program_interface_query: add tests for getprogramresourceindex

2015-03-26 Thread Martin Peres

On 25/03/15 18:01, Martin Peres wrote:

Tests tricky cases of resource naming along with some error cases of
getprogramresourceindex. It also replaces the resource-index test that
was incomplete and did not consistently report the same number of
subtests depending on errors.

Signed-off-by: Martin Peres martin.pe...@linux.intel.org
---
  tests/all.py   |   2 +-
  .../arb_program_interface_query/CMakeLists.gl.txt  |   2 +-
  tests/spec/arb_program_interface_query/common.h|  21 ++
  .../getprogramresourceindex.c  | 338 +
  .../arb_program_interface_query/resource-index.c   | 284 -
  5 files changed, 361 insertions(+), 286 deletions(-)
  create mode 100755 
tests/spec/arb_program_interface_query/getprogramresourceindex.c
  delete mode 100644 tests/spec/arb_program_interface_query/resource-index.c

diff --git a/tests/all.py b/tests/all.py
index 86f2369..170d5b8 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2273,9 +2273,9 @@ with profile.group_manager(
  PiglitGLTest,
  grouptools.join('spec', 'ARB_program_interface_query')) as g:
  g(['arb_program_interface_query-resource-location'], run_concurrent=False)
-g(['arb_program_interface_query-resource-index'], run_concurrent=False)
  g(['arb_program_interface_query-resource-query'], run_concurrent=False)
  g(['arb_program_interface_query-getprograminterfaceiv'], 
run_concurrent=False)
+g(['arb_program_interface_query-getprogramresourceindex'], 
run_concurrent=False)
  
  # Group ARB_explicit_uniform_location

  with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 91ace72..8b3bbd9 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -10,6 +10,6 @@ link_libraries (
  )
  
  piglit_add_executable (arb_program_interface_query-resource-location resource-location.c)

-piglit_add_executable (arb_program_interface_query-resource-index 
resource-index.c)
  piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
  piglit_add_executable (arb_program_interface_query-getprograminterfaceiv 
getprograminterfaceiv.c)
+piglit_add_executable (arb_program_interface_query-getprogramresourceindex 
getprogramresourceindex.c)
diff --git a/tests/spec/arb_program_interface_query/common.h 
b/tests/spec/arb_program_interface_query/common.h
index cc0b2bd..457e79e 100755
--- a/tests/spec/arb_program_interface_query/common.h
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -35,6 +35,27 @@ static const char fs_empty[] =
void main() {\n
};
  
+static const char vs_array[] =

+   #version 150\n
+   in vec4 vs_input[2];\n
+   struct vs_struct {\n
+ vec4 hello;\n
+ vec4 world[2];\n
+   };\n
+   uniform vs_struct sa[2];\n
+   void main() {\n
+ gl_Position = vs_input[0] + sa[0].hello + sa[0].world[0];\n
+   };
+
+static const char vs_aofa[] =
+   #version 150\n
+   #extension GL_ARB_arrays_of_arrays : require\n
+   in vec4 vs_input2[2][2];\n
+   in vec4 vs_input3[2][2][2];\n
+   void main() {\n
+ gl_Position = vs_input2[0][0] + vs_input3[0][0][0];\n
+   };
+
  static const char vs_std[] =
#version 150\n
struct vs_struct {\n
diff --git a/tests/spec/arb_program_interface_query/getprogramresourceindex.c 
b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
new file mode 100755
index 000..41aac3d
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
@@ -0,0 +1,338 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file getprogramresourceindex.c
+ *
+ * Tests the 

Re: [Piglit] [PATCH 3/4] program_interface_query: add tests for getprogramresourceindex

2015-03-26 Thread Tapani Pälli



On 03/26/2015 12:35 PM, Tapani Pälli wrote:



On 03/25/2015 06:01 PM, Martin Peres wrote:

Tests tricky cases of resource naming along with some error cases of
getprogramresourceindex. It also replaces the resource-index test that
was incomplete and did not consistently report the same number of
subtests depending on errors.

Signed-off-by: Martin Peres martin.pe...@linux.intel.org
---
  tests/all.py   |   2 +-
  .../arb_program_interface_query/CMakeLists.gl.txt  |   2 +-
  tests/spec/arb_program_interface_query/common.h|  21 ++
  .../getprogramresourceindex.c  | 338
+
  .../arb_program_interface_query/resource-index.c   | 284
-
  5 files changed, 361 insertions(+), 286 deletions(-)
  create mode 100755
tests/spec/arb_program_interface_query/getprogramresourceindex.c
  delete mode 100644
tests/spec/arb_program_interface_query/resource-index.c

diff --git a/tests/all.py b/tests/all.py
index 86f2369..170d5b8 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2273,9 +2273,9 @@ with profile.group_manager(
  PiglitGLTest,
  grouptools.join('spec', 'ARB_program_interface_query')) as g:
  g(['arb_program_interface_query-resource-location'],
run_concurrent=False)
-g(['arb_program_interface_query-resource-index'],
run_concurrent=False)
  g(['arb_program_interface_query-resource-query'],
run_concurrent=False)
  g(['arb_program_interface_query-getprograminterfaceiv'],
run_concurrent=False)
+g(['arb_program_interface_query-getprogramresourceindex'],
run_concurrent=False)

  # Group ARB_explicit_uniform_location
  with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 91ace72..8b3bbd9 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -10,6 +10,6 @@ link_libraries (
  )

  piglit_add_executable (arb_program_interface_query-resource-location
resource-location.c)
-piglit_add_executable (arb_program_interface_query-resource-index
resource-index.c)
  piglit_add_executable (arb_program_interface_query-resource-query
resource-query.c)
  piglit_add_executable
(arb_program_interface_query-getprograminterfaceiv
getprograminterfaceiv.c)
+piglit_add_executable
(arb_program_interface_query-getprogramresourceindex
getprogramresourceindex.c)
diff --git a/tests/spec/arb_program_interface_query/common.h
b/tests/spec/arb_program_interface_query/common.h
index cc0b2bd..457e79e 100755
--- a/tests/spec/arb_program_interface_query/common.h
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -35,6 +35,27 @@ static const char fs_empty[] =
  void main() {\n
  };

+static const char vs_array[] =
+#version 150\n
+in vec4 vs_input[2];\n
+struct vs_struct {\n
+vec4 hello;\n
+vec4 world[2];\n
+};\n
+uniform vs_struct sa[2];\n
+void main() {\n
+gl_Position = vs_input[0] + sa[0].hello + sa[0].world[0];\n
+};
+
+static const char vs_aofa[] =
+#version 150\n
+#extension GL_ARB_arrays_of_arrays : require\n
+in vec4 vs_input2[2][2];\n
+in vec4 vs_input3[2][2][2];\n
+void main() {\n
+gl_Position = vs_input2[0][0] + vs_input3[0][0][0];\n
+};
+
  static const char vs_std[] =
  #version 150\n
  struct vs_struct {\n
diff --git
a/tests/spec/arb_program_interface_query/getprogramresourceindex.c
b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
new file mode 100755
index 000..41aac3d
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
@@ -0,0 +1,338 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person
obtaining a
+ * copy of this software and associated documentation files (the
Software),
+ * to deal in the Software without restriction, including without
limitation
+ * the rights to use, copy, modify, merge, publish, distribute,
sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including
the next
+ * paragraph) shall be included in all copies or substantial portions
of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file getprogramresourceindex.c
+ *
+ * Tests the errors reported by 

Re: [Piglit] [PATCH 2/4] program_interface_query: add tests for getprograminterfaceiv

2015-03-26 Thread Martin Peres

On 26/03/15 11:01, Tapani Pälli wrote:
Also with this test we could have the NULL input test, to trigger bad 
things I think it needs to have non-empty shaders though, something like:


glGetProgramInterfaceiv(prog, GL_PROGRAM_OUTPUT, GL_MAX_NAME_LENGTH, 
NULL);


(some legal query that triggers driver to iterate resources and try to 
write to NULL)


Otherwise all the errors mentioned in the spec are tested, with null 
test addition;


I disagree with this one. The spec really is undefined for this and 
crashing is an acceptable
behaviour. I am fine with mesa testing for it, but we should not force 
every driver to

not crash.



Reviewed-by: Tapani Pälli tapani.pa...@intel.com


As discussed IRL, I will keep your R-b :)




On 03/25/2015 06:01 PM, Martin Peres wrote:

This test exercises the error codepaths of getprograminterfaceiv.

Signed-off-by: Martin Peres martin.pe...@linux.intel.com
---
  tests/all.py   |   1 +
  .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
  tests/spec/arb_program_interface_query/common.h|  10 +
  .../getprograminterfaceiv.c| 202 
+

  4 files changed, 214 insertions(+)
  create mode 100755 
tests/spec/arb_program_interface_query/getprograminterfaceiv.c


diff --git a/tests/all.py b/tests/all.py
index f47e198..86f2369 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -2275,6 +2275,7 @@ with profile.group_manager(
  g(['arb_program_interface_query-resource-location'], 
run_concurrent=False)
  g(['arb_program_interface_query-resource-index'], 
run_concurrent=False)
  g(['arb_program_interface_query-resource-query'], 
run_concurrent=False)
+g(['arb_program_interface_query-getprograminterfaceiv'], 
run_concurrent=False)


  # Group ARB_explicit_uniform_location
  with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt

index 9535798..91ace72 100755
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -12,3 +12,4 @@ link_libraries (
  piglit_add_executable 
(arb_program_interface_query-resource-location resource-location.c)
  piglit_add_executable (arb_program_interface_query-resource-index 
resource-index.c)
  piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
+piglit_add_executable 
(arb_program_interface_query-getprograminterfaceiv 
getprograminterfaceiv.c)
diff --git a/tests/spec/arb_program_interface_query/common.h 
b/tests/spec/arb_program_interface_query/common.h

index 4e5ff01..cc0b2bd 100755
--- a/tests/spec/arb_program_interface_query/common.h
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -25,6 +25,16 @@
  #ifndef __COMMON_H__
  #define __COMMON_H__

+static const char vs_empty[] =
+#version 150\n
+void main() {\n
+};
+
+static const char fs_empty[] =
+#version 150\n
+void main() {\n
+};
+
  static const char vs_std[] =
  #version 150\n
  struct vs_struct {\n
diff --git 
a/tests/spec/arb_program_interface_query/getprograminterfaceiv.c 
b/tests/spec/arb_program_interface_query/getprograminterfaceiv.c

new file mode 100755
index 000..1d2ca08
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/getprograminterfaceiv.c
@@ -0,0 +1,202 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person 
obtaining a
+ * copy of this software and associated documentation files (the 
Software),
+ * to deal in the Software without restriction, including without 
limitation
+ * the rights to use, copy, modify, merge, publish, distribute, 
sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom 
the

+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including 
the next
+ * paragraph) shall be included in all copies or substantial 
portions of the

+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, 
EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO 
EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES 
OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
OTHER DEALINGS

+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file getprograminterfaceiv.c
+ *
+ * Tests the error cases of the GetProgramInterfaceiv interface.
+ *
+ * From the GL_ARB_program_interface_query spec:
+ *  The command
+ *
+ *  void GetProgramInterfaceiv(uint program, enum programInterface,
+ * enum pname, int *params);
+ *
+ *  queries a property of the interface programInterface in 
program
+ *  

Re: [Piglit] [PATCH] generator: clear before rendering with the builtin tests

2015-03-26 Thread Ilia Mirkin
Can we just make shader_runner do a clear automatically? This has
happened to me a number of times.

On Thu, Mar 26, 2015 at 9:58 PM, Dave Airlie airl...@gmail.com wrote:
 From: Dave Airlie airl...@redhat.com

 Otherwise there is a chance you'll get the contents from the last
 test which are green, and if this test fails to renderer you'll pass.

 Signed-off-by: Dave Airlie airl...@redhat.com
 ---
  generated_tests/gen_builtin_uniform_tests.py  | 2 ++
  generated_tests/gen_builtin_uniform_tests_fp64.py | 2 ++
  2 files changed, 4 insertions(+)

 diff --git a/generated_tests/gen_builtin_uniform_tests.py 
 b/generated_tests/gen_builtin_uniform_tests.py
 index 528c2c1..b61f95f 100644
 --- a/generated_tests/gen_builtin_uniform_tests.py
 +++ b/generated_tests/gen_builtin_uniform_tests.py
 @@ -538,6 +538,8 @@ class ShaderTest(object):
  if vs:
  shader_test += self.make_vbo_data()
  shader_test += '[test]\n'
 +shader_test += 'clear color 0.0 0.0 1.0 0.0\n'
 +shader_test += 'clear\n'
  shader_test += self.make_test()
  filename = self.filename()
  dirname = os.path.dirname(filename)
 diff --git a/generated_tests/gen_builtin_uniform_tests_fp64.py 
 b/generated_tests/gen_builtin_uniform_tests_fp64.py
 index cc53d0c..78c2ace 100644
 --- a/generated_tests/gen_builtin_uniform_tests_fp64.py
 +++ b/generated_tests/gen_builtin_uniform_tests_fp64.py
 @@ -508,6 +508,8 @@ class ShaderTest(object):
  shader_test += '\n'
  shader_test += self.make_vbo_data()
  shader_test += '[test]\n'
 +shader_test += 'clear color 0.0 0.0 1.0 0.0\n'
 +shader_test += 'clear\n'
  shader_test += self.make_test()
  filename = self.filename()
  dirname = os.path.dirname(filename)
 --
 2.1.0

 ___
 Piglit mailing list
 Piglit@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 2/2] igt.py: don't check the environment when in dry-run mode

2015-03-26 Thread Dylan Baker
for the series:
Reviewed-by: Dylan Baker baker.dyla...@gmail.com

On Thu, Mar 26, 2015 at 03:43:17PM +, Thomas Wood wrote:
 Don't exit during the post run hook if the environment check fails and
 dry-run mode is enabled.
 
 Signed-off-by: Thomas Wood thomas.w...@intel.com
 ---
  tests/igt.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/tests/igt.py b/tests/igt.py
 index 8c7963b..8ffac8d 100644
 --- a/tests/igt.py
 +++ b/tests/igt.py
 @@ -92,7 +92,7 @@ else:
  class IGTTestProfile(TestProfile):
  Test profile for intel-gpu-tools tests.
  def _pre_run_hook(self, opts):
 -if not check_environment():
 +if opts.execute and not check_environment():
  sys.exit(1)
  
  
 -- 
 2.1.0
 
 ___
 Piglit mailing list
 Piglit@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/piglit


signature.asc
Description: Digital signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] gl-2.0: port const vertex attrib webgl test to piglit

2015-03-26 Thread Ilia Mirkin
This is a rip off of:

https://www.khronos.org/registry/webgl/conformance-suites/1.0.2/conformance/attribs/gl-vertex-attrib-render.html

Which presently fails with gallium drivers. The logic is identical, just
ported to GL and piglit infra.

Signed-off-by: Ilia Mirkin imir...@alum.mit.edu
---
 tests/all.py  |   1 +
 tests/spec/gl-2.0/CMakeLists.gl.txt   |   1 +
 tests/spec/gl-2.0/vertex-const-attr.c | 136 ++
 3 files changed, 138 insertions(+)
 create mode 100644 tests/spec/gl-2.0/vertex-const-attr.c

diff --git a/tests/all.py b/tests/all.py
index b2266db..93bf120 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1049,6 +1049,7 @@ with profile.group_manager(
 g(['gl-2.0-edgeflag'])
 g(['gl-2.0-edgeflag-immediate'])
 g(['gl-2.0-vertexattribpointer'])
+g(['gl-2.0-vertex-const-attr'])
 g(['attrib-assignments'], run_concurrent=False)
 g(['getattriblocation-conventional'], run_concurrent=False)
 g(['clip-flag-behavior'], run_concurrent=False)
diff --git a/tests/spec/gl-2.0/CMakeLists.gl.txt 
b/tests/spec/gl-2.0/CMakeLists.gl.txt
index 3ac0d68..2ce99bd 100644
--- a/tests/spec/gl-2.0/CMakeLists.gl.txt
+++ b/tests/spec/gl-2.0/CMakeLists.gl.txt
@@ -14,3 +14,4 @@ piglit_add_executable (vertex-program-two-side 
vertex-program-two-side.c)
 piglit_add_executable (gl-2.0-edgeflag edgeflag.c)
 piglit_add_executable (gl-2.0-edgeflag-immediate edgeflag-immediate.c)
 piglit_add_executable (gl-2.0-vertexattribpointer vertexattribpointer.c)
+piglit_add_executable (gl-2.0-vertex-const-attr vertex-const-attr.c)
diff --git a/tests/spec/gl-2.0/vertex-const-attr.c 
b/tests/spec/gl-2.0/vertex-const-attr.c
new file mode 100644
index 000..33b01f7
--- /dev/null
+++ b/tests/spec/gl-2.0/vertex-const-attr.c
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2012 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and/or associated documentation files (the
+ * Materials), to deal in the Materials without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Materials, and to
+ * permit persons to whom the Materials are furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Materials.
+ *
+ * THE MATERIALS ARE PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ *
+ * Adapted for Piglit and OpenGL by:
+ *   Ilia Mirkin
+ */
+
+/**
+ * Test glVertexAtribNfv changes and redraws without changing any other state
+ */
+
+#include piglit-util-gl.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 20;
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+PIGLIT_GL_TEST_CONFIG_END
+
+static const char *vs =
+   attribute vec2 vertex; \n
+   attribute vec4 attr; \n
+   varying vec4 color; \n
+   void main() { \n
+ gl_Position = vec4(vertex, 0, 1); \n
+ color = attr; \n
+   }\n;
+
+static const char *fs =
+   varying vec4 color; \n
+   void main() { gl_FragColor = color; } \n;
+
+static GLint prog, attr;
+
+enum piglit_result
+piglit_display(void)
+{
+   float color[4][4] = {
+   {1, 0, 0, 1},
+   {0, 1, 0, 1},
+   {0, 0, 1, 1},
+   {1, 1, 1, 1},
+   };
+   bool pass = true;
+
+   glViewport(0, 0, piglit_width, piglit_height);
+   glClearColor(0.5, 0.5, 0.5, 0.5);
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   glVertexAttrib1fv(attr, color[0]);
+   glViewport(0, 0, piglit_width/2, piglit_height/2);
+   glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+
+   glVertexAttrib2fv(attr, color[1]);
+   glViewport(0, piglit_height/2, piglit_width/2, piglit_height/2);
+   glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+
+   glVertexAttrib3fv(attr, color[2]);
+   glViewport(piglit_width/2, 0, piglit_width/2, piglit_height/2);
+   glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+
+   glVertexAttrib4fv(attr, color[3]);
+   glViewport(piglit_width/2, piglit_height/2,
+  piglit_width/2, piglit_height/2);
+   glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+
+   pass = piglit_probe_rect_rgba(0, 0,
+  piglit_width / 2, piglit_height / 2,
+  color[0]);
+   pass = piglit_probe_rect_rgba(0, piglit_height / 2,
+ 

Re: [Piglit] [PATCH] gl-2.0: port const vertex attrib webgl test to piglit

2015-03-26 Thread Marek Olšák
Reviewed-by: Marek Olšák marek.ol...@amd.com

Marek

On Thu, Mar 26, 2015 at 6:10 PM, Ilia Mirkin imir...@alum.mit.edu wrote:
 This is a rip off of:

 https://www.khronos.org/registry/webgl/conformance-suites/1.0.2/conformance/attribs/gl-vertex-attrib-render.html

 Which presently fails with gallium drivers. The logic is identical, just
 ported to GL and piglit infra.

 Signed-off-by: Ilia Mirkin imir...@alum.mit.edu
 ---
  tests/all.py  |   1 +
  tests/spec/gl-2.0/CMakeLists.gl.txt   |   1 +
  tests/spec/gl-2.0/vertex-const-attr.c | 136 
 ++
  3 files changed, 138 insertions(+)
  create mode 100644 tests/spec/gl-2.0/vertex-const-attr.c

 diff --git a/tests/all.py b/tests/all.py
 index b2266db..93bf120 100644
 --- a/tests/all.py
 +++ b/tests/all.py
 @@ -1049,6 +1049,7 @@ with profile.group_manager(
  g(['gl-2.0-edgeflag'])
  g(['gl-2.0-edgeflag-immediate'])
  g(['gl-2.0-vertexattribpointer'])
 +g(['gl-2.0-vertex-const-attr'])
  g(['attrib-assignments'], run_concurrent=False)
  g(['getattriblocation-conventional'], run_concurrent=False)
  g(['clip-flag-behavior'], run_concurrent=False)
 diff --git a/tests/spec/gl-2.0/CMakeLists.gl.txt 
 b/tests/spec/gl-2.0/CMakeLists.gl.txt
 index 3ac0d68..2ce99bd 100644
 --- a/tests/spec/gl-2.0/CMakeLists.gl.txt
 +++ b/tests/spec/gl-2.0/CMakeLists.gl.txt
 @@ -14,3 +14,4 @@ piglit_add_executable (vertex-program-two-side 
 vertex-program-two-side.c)
  piglit_add_executable (gl-2.0-edgeflag edgeflag.c)
  piglit_add_executable (gl-2.0-edgeflag-immediate edgeflag-immediate.c)
  piglit_add_executable (gl-2.0-vertexattribpointer vertexattribpointer.c)
 +piglit_add_executable (gl-2.0-vertex-const-attr vertex-const-attr.c)
 diff --git a/tests/spec/gl-2.0/vertex-const-attr.c 
 b/tests/spec/gl-2.0/vertex-const-attr.c
 new file mode 100644
 index 000..33b01f7
 --- /dev/null
 +++ b/tests/spec/gl-2.0/vertex-const-attr.c
 @@ -0,0 +1,136 @@
 +/*
 + * Copyright (c) 2012 The Khronos Group Inc.
 + *
 + * Permission is hereby granted, free of charge, to any person obtaining a
 + * copy of this software and/or associated documentation files (the
 + * Materials), to deal in the Materials without restriction, including
 + * without limitation the rights to use, copy, modify, merge, publish,
 + * distribute, sublicense, and/or sell copies of the Materials, and to
 + * permit persons to whom the Materials are furnished to do so, subject to
 + * the following conditions:
 + *
 + * The above copyright notice and this permission notice shall be included
 + * in all copies or substantial portions of the Materials.
 + *
 + * THE MATERIALS ARE PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND,
 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 + *
 + * Adapted for Piglit and OpenGL by:
 + *   Ilia Mirkin
 + */
 +
 +/**
 + * Test glVertexAtribNfv changes and redraws without changing any other state
 + */
 +
 +#include piglit-util-gl.h
 +
 +PIGLIT_GL_TEST_CONFIG_BEGIN
 +   config.supports_gl_compat_version = 20;
 +   config.window_visual = PIGLIT_GL_VISUAL_RGBA | 
 PIGLIT_GL_VISUAL_DOUBLE;
 +PIGLIT_GL_TEST_CONFIG_END
 +
 +static const char *vs =
 +   attribute vec2 vertex; \n
 +   attribute vec4 attr; \n
 +   varying vec4 color; \n
 +   void main() { \n
 + gl_Position = vec4(vertex, 0, 1); \n
 + color = attr; \n
 +   }\n;
 +
 +static const char *fs =
 +   varying vec4 color; \n
 +   void main() { gl_FragColor = color; } \n;
 +
 +static GLint prog, attr;
 +
 +enum piglit_result
 +piglit_display(void)
 +{
 +   float color[4][4] = {
 +   {1, 0, 0, 1},
 +   {0, 1, 0, 1},
 +   {0, 0, 1, 1},
 +   {1, 1, 1, 1},
 +   };
 +   bool pass = true;
 +
 +   glViewport(0, 0, piglit_width, piglit_height);
 +   glClearColor(0.5, 0.5, 0.5, 0.5);
 +   glClear(GL_COLOR_BUFFER_BIT);
 +
 +   glVertexAttrib1fv(attr, color[0]);
 +   glViewport(0, 0, piglit_width/2, piglit_height/2);
 +   glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
 +
 +   glVertexAttrib2fv(attr, color[1]);
 +   glViewport(0, piglit_height/2, piglit_width/2, piglit_height/2);
 +   glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
 +
 +   glVertexAttrib3fv(attr, color[2]);
 +   glViewport(piglit_width/2, 0, piglit_width/2, piglit_height/2);
 +   glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
 +
 +   glVertexAttrib4fv(attr, color[3]);
 +   glViewport(piglit_width/2, piglit_height/2,
 +  piglit_width/2, piglit_height/2);
 +   

Re: [Piglit] [PATCH 1/3] cl: add acospi test

2015-03-26 Thread Tom Stellard
On Wed, Mar 25, 2015 at 01:33:49PM -0400, Jan Vesely wrote:
 copied from acos.
 tested on clover and intel ocl
 
 Signed-off-by: Jan Vesely jan.ves...@rutgers.edu

For the series:

Reviewed-by: Tom Stellard thomas.stell...@amd.com

 ---
  generated_tests/gen_cl_math_builtins.py | 10 ++
  1 file changed, 10 insertions(+)
 
 diff --git a/generated_tests/gen_cl_math_builtins.py 
 b/generated_tests/gen_cl_math_builtins.py
 index 30d0c43..0890fa1 100644
 --- a/generated_tests/gen_cl_math_builtins.py
 +++ b/generated_tests/gen_cl_math_builtins.py
 @@ -33,6 +33,7 @@ from math import fabs, fmod, log10, log1p, pi, pow, sin, 
 sinh, sqrt, tan, tanh
  CLC_VERSION_MIN = {
  'acos' : 10,
  'acosh' : 10,
 +'acospi' : 10,
  'asin' : 10,
  'asinh' : 10,
  'atan' : 10,
 @@ -96,6 +97,15 @@ tests = {
  ],
  'tolerance' : 4
   },
 +'acospi' : {
 +'arg_types' : [F, F],
 +'function_type': 'ttt',
 +'values' : [
 +[ 1,  1/2, 0.0, acos(0.12345) / pi, float(nan)], # Result
 +[-1.0, 0.0,  1.0,  0.12345,  float(nan)]  # Arg0
 +],
 +'tolerance' : 5
 + },
  'asin' : {
  'arg_types' : [F, F],
  'function_type': 'ttt',
 -- 
 2.1.0
 
 ___
 Piglit mailing list
 Piglit@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/4] glsl-1.20: Use [vertex shader passthrough] in notEqual tests

2015-03-26 Thread Anuj Phogat
On Mon, Mar 23, 2015 at 12:02 PM, Ian Romanick i...@freedesktop.org wrote:
 From: Ian Romanick ian.d.roman...@intel.com

 Signed-off-by: Ian Romanick ian.d.roman...@intel.com
 ---
  tests/shaders/glsl-const-builtin-notEqual-bool.shader_test | 6 +-
  tests/shaders/glsl-const-builtin-notEqual.shader_test  | 6 +-
  2 files changed, 2 insertions(+), 10 deletions(-)

 diff --git a/tests/shaders/glsl-const-builtin-notEqual-bool.shader_test 
 b/tests/shaders/glsl-const-builtin-notEqual-bool.shader_test
 index 075834b..8397892 100644
 --- a/tests/shaders/glsl-const-builtin-notEqual-bool.shader_test
 +++ b/tests/shaders/glsl-const-builtin-notEqual-bool.shader_test
 @@ -1,11 +1,7 @@
  [require]
  GLSL = 1.20

 -[vertex shader]
 -void main()
 -{
 -   gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
 -}
 +[vertex shader passthrough]

  [fragment shader]
  void main() {
 diff --git a/tests/shaders/glsl-const-builtin-notEqual.shader_test 
 b/tests/shaders/glsl-const-builtin-notEqual.shader_test
 index 7092169..9dee00a 100644
 --- a/tests/shaders/glsl-const-builtin-notEqual.shader_test
 +++ b/tests/shaders/glsl-const-builtin-notEqual.shader_test
 @@ -1,11 +1,7 @@
  [require]
  GLSL = 1.20

 -[vertex shader]
 -void main()
 -{
 -   gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
 -}
 +[vertex shader passthrough]

  [fragment shader]
  void main() {
 --
 2.1.0

 ___
 Piglit mailing list
 Piglit@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/piglit

Series is:
Reviewed-by: Anuj Phogat anuj.pho...@gmail.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] generator: clear before rendering with the builtin tests

2015-03-26 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

Otherwise there is a chance you'll get the contents from the last
test which are green, and if this test fails to renderer you'll pass.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 generated_tests/gen_builtin_uniform_tests.py  | 2 ++
 generated_tests/gen_builtin_uniform_tests_fp64.py | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/generated_tests/gen_builtin_uniform_tests.py 
b/generated_tests/gen_builtin_uniform_tests.py
index 528c2c1..b61f95f 100644
--- a/generated_tests/gen_builtin_uniform_tests.py
+++ b/generated_tests/gen_builtin_uniform_tests.py
@@ -538,6 +538,8 @@ class ShaderTest(object):
 if vs:
 shader_test += self.make_vbo_data()
 shader_test += '[test]\n'
+shader_test += 'clear color 0.0 0.0 1.0 0.0\n'
+shader_test += 'clear\n'
 shader_test += self.make_test()
 filename = self.filename()
 dirname = os.path.dirname(filename)
diff --git a/generated_tests/gen_builtin_uniform_tests_fp64.py 
b/generated_tests/gen_builtin_uniform_tests_fp64.py
index cc53d0c..78c2ace 100644
--- a/generated_tests/gen_builtin_uniform_tests_fp64.py
+++ b/generated_tests/gen_builtin_uniform_tests_fp64.py
@@ -508,6 +508,8 @@ class ShaderTest(object):
 shader_test += '\n'
 shader_test += self.make_vbo_data()
 shader_test += '[test]\n'
+shader_test += 'clear color 0.0 0.0 1.0 0.0\n'
+shader_test += 'clear\n'
 shader_test += self.make_test()
 filename = self.filename()
 dirname = os.path.dirname(filename)
-- 
2.1.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/4] program_interface_query: add tests for querying the resources

2015-03-26 Thread Martin Peres

On 25/03/15 18:01, Martin Peres wrote:

This tests primarily glGetProgramInterfaceiv in various (potentially
tricky) program pipelines. All the calls are supposed to succeed as
this test is purely functional.

This test requires a OpenGL 3.2 core context but also has optional
subtests that depend on the following extensions:
  - GL_ARB_shader_atomic_counters
  - GL_ARB_shader_storage_buffer_object
  - GL_ARB_shader_subroutine
  - GL_ARB_tessellation_shader
  - GL_ARB_compute_shader
  - GL_ARB_shader_image_load_store

Signed-off-by: Martin Peres martin.pe...@linux.intel.com
---
  tests/all.py   |   1 +
  .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
  tests/spec/arb_program_interface_query/common.h| 238 +++
  .../arb_program_interface_query/resource-query.c   | 741 +
  4 files changed, 981 insertions(+)
  mode change 100644 = 100755 tests/all.py
  mode change 100644 = 100755 
tests/spec/arb_program_interface_query/CMakeLists.gl.txt
  create mode 100755 tests/spec/arb_program_interface_query/common.h
  create mode 100755 tests/spec/arb_program_interface_query/resource-query.c

diff --git a/tests/all.py b/tests/all.py
old mode 100644
new mode 100755
index b2266db..f47e198
--- a/tests/all.py
+++ b/tests/all.py
@@ -2274,6 +2274,7 @@ with profile.group_manager(
  grouptools.join('spec', 'ARB_program_interface_query')) as g:
  g(['arb_program_interface_query-resource-location'], run_concurrent=False)
  g(['arb_program_interface_query-resource-index'], run_concurrent=False)
+g(['arb_program_interface_query-resource-query'], run_concurrent=False)
  
  # Group ARB_explicit_uniform_location

  with profile.group_manager(
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
old mode 100644
new mode 100755
index 2028553..9535798
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -11,3 +11,4 @@ link_libraries (
  
  piglit_add_executable (arb_program_interface_query-resource-location resource-location.c)

  piglit_add_executable (arb_program_interface_query-resource-index 
resource-index.c)
+piglit_add_executable (arb_program_interface_query-resource-query 
resource-query.c)
diff --git a/tests/spec/arb_program_interface_query/common.h 
b/tests/spec/arb_program_interface_query/common.h
new file mode 100755
index 000..4e5ff01
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/common.h
@@ -0,0 +1,238 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#pragma once
+#ifndef __COMMON_H__
+#define __COMMON_H__
+
+static const char vs_std[] =
+   #version 150\n
+   struct vs_struct {\n
+ vec4 a[2];\n
+   };\n
+   uniform vs_uniform_block {\n
+ vec4 vs_test;\n
+   };\n
+   uniform vs_struct sa[2];\n
+   in vec4 vs_input0;\n
+   in vec4 vs_input1;\n
+   void main() {\n
+ gl_Position = vs_input0 * vs_test * vs_input1 + sa[0].a[1] +
+   sa[1].a[1];\n
+   };
+
+const char gs_std[] =
+   #version 150\n
+   layout(triangles) in;\n
+   layout(triangle_strip, max_vertices = 6) out;\n
+   uniform gs_uniform_block {\n
+ vec4 gs_test;\n
+   };\n
+   in vec4 gs_input[3];\n
+   out vec4 gs_output0;\n
+   void main() {\n
+ for (int i = 0; i  6; i++) {\n
+ gl_Position = gs_input[i % 3] *
+   gl_in[i % 3].gl_Position * gs_test;\n
+ gs_output0 = gs_input[0];\n
+ EmitVertex();\n
+ }\n
+   }\n;
+
+static const char fs_std[] =
+   #version 150\n
+   uniform fs_uniform_block {
+ vec4 fs_color;\n
+ float fs_array[4];\n
+   };
+   in 

[Piglit] [PATCH 2/2] igt.py: don't check the environment when in dry-run mode

2015-03-26 Thread Thomas Wood
Don't exit during the post run hook if the environment check fails and
dry-run mode is enabled.

Signed-off-by: Thomas Wood thomas.w...@intel.com
---
 tests/igt.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/igt.py b/tests/igt.py
index 8c7963b..8ffac8d 100644
--- a/tests/igt.py
+++ b/tests/igt.py
@@ -92,7 +92,7 @@ else:
 class IGTTestProfile(TestProfile):
 Test profile for intel-gpu-tools tests.
 def _pre_run_hook(self, opts):
-if not check_environment():
+if opts.execute and not check_environment():
 sys.exit(1)
 
 
-- 
2.1.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/2] profile.py: pass options to the pre and post run hooks

2015-03-26 Thread Thomas Wood
Signed-off-by: Thomas Wood thomas.w...@intel.com
---
 framework/profile.py | 12 
 tests/igt.py |  2 +-
 tests/xts.py |  2 +-
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/framework/profile.py b/framework/profile.py
index 603e872..1384bbd 100644
--- a/framework/profile.py
+++ b/framework/profile.py
@@ -168,21 +168,25 @@ class TestProfile(object):
   file=sys.stderr)
 sys.exit(1)
 
-def _pre_run_hook(self):
+def _pre_run_hook(self, opts):
  Hook executed at the start of TestProfile.run
 
 To make use of this hook one will need to subclass TestProfile, and
 set this to do something, as be default it will no-op
 
+Arguments:
+opts -- a core.Options instance
 
 pass
 
-def _post_run_hook(self):
+def _post_run_hook(self, opts):
  Hook executed at the end of TestProfile.run
 
 To make use of this hook one will need to subclass TestProfile, and
 set this to do something, as be default it will no-op
 
+Arguments:
+opts -- a core.Options instance
 
 pass
 
@@ -205,7 +209,7 @@ class TestProfile(object):
 
 
 
-self._pre_run_hook()
+self._pre_run_hook(opts)
 Test.OPTS = opts
 
 chunksize = 1
@@ -250,7 +254,7 @@ class TestProfile(object):
 
 log.get().summary()
 
-self._post_run_hook()
+self._post_run_hook(opts)
 
 def filter_tests(self, function):
 Filter out tests that return false from the supplied function
diff --git a/tests/igt.py b/tests/igt.py
index 1bc7f23..8c7963b 100644
--- a/tests/igt.py
+++ b/tests/igt.py
@@ -91,7 +91,7 @@ else:
 
 class IGTTestProfile(TestProfile):
 Test profile for intel-gpu-tools tests.
-def _pre_run_hook(self):
+def _pre_run_hook(self, opts):
 if not check_environment():
 sys.exit(1)
 
diff --git a/tests/xts.py b/tests/xts.py
index 0e277dc..3ac931d 100644
--- a/tests/xts.py
+++ b/tests/xts.py
@@ -41,7 +41,7 @@ X_TEST_SUITE = framework.core.PIGLIT_CONFIG.get('xts', 'path')
 
 class XTSProfile(TestProfile):  # pylint: disable=too-few-public-methods
  A subclass of TestProfile that provides a setup hook for XTS 
-def _pre_run_hook(self):
+def _pre_run_hook(self, opts):
  This hook sets the XTSTest.results_path variable
 
 Setting this variable allows images created by XTS to moved into the
-- 
2.1.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit