[Piglit] [PATCH] framework/shader_test: Assume the api is GL if no requirements are found

Chad Versace chad.versace at linux.intel.com
Tue Dec 11 16:24:54 PST 2012


Commit 260f211 caused some shader tests to regress with the message:
"Failed to find [require] block".

This patch changes the python script that drives shader_runner to assume
that the test's API is GL if no GL requirement is found in the test file.
This behavior matches the behavior of the shader_runner executable, whose
default requirements are GL >= 1.0 and GLSL >= 1.10.

I tested this patch by running `piglit-run.py -t glsl -t shader` and then
grepping the result file for "Failed to find".

CC: Tom Gall <tom.gall at linaro.org>
CC: Ian Romanick <idr at freedesktop.org>
Reported-by: Ian Romanick <idr at freedesktop.org>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 framework/shader_test.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/framework/shader_test.py b/framework/shader_test.py
index a587f37..ea637cf 100755
--- a/framework/shader_test.py
+++ b/framework/shader_test.py
@@ -196,13 +196,13 @@ class ShaderTest(PlainExecTest):
                     else:
                         assert(False)
 
-                # Failed to parse the GL requirement.
-                self.__gl_api = ShaderTest.API_ERROR
-
-                if parse_state == PARSE_FIND_REQUIRE_HEADER:
-                    self.__report_failure("Failed to find [require] block")
-                elif parse_state == PARSE_FIND_GL_REQUIREMENT:
-                    self.__report_failure("Failed to find end of [require] block")
+                if parse_state == PARSE_FIND_REQUIRE_HEADER or \
+                   parse_state == PARSE_FIND_GL_REQUIREMENT:
+                    # If no requirements are found, then assume the required
+                    # API is GL. This matches the behavior of the
+                    # shader_runner executable, whose default requirements are
+                    # GL >= 1.0 and GLSL >= 1.10.
+                    self.__gl_api = ShaderTest.API_GL
                 else:
                     assert(False)
 
-- 
1.7.11.7



More information about the Piglit mailing list