[Piglit] [PATCH 4/6] shader_runner: Allow whitespace before [require] declarations

Dylan Baker dylan at pnwbakers.com
Tue Jun 7 21:15:11 UTC 2016


Currently any leading whitespace in a line of the require section
results in that line being skipped. This is less than optimal because of
generated tests that may want to make their templates more readable at
the expense of having some odd indent in the produced shader.

This is required to get the new, faster templates later in this series
working.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 tests/shaders/shader_runner.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 94c7826..5b1acb0 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -813,6 +813,11 @@ process_requirement(const char *line)
 		return;
 	}
 
+	/* Consume any leading whitespace before requirements. This is
+	 * important for generated test files that may have odd whitespace
+	 */
+	line = eat_whitespace(line);
+
 	if (string_match("GL_", line)) {
 		strcpy_to_space(buffer, line);
 		piglit_require_extension(buffer);
-- 
2.8.3



More information about the Piglit mailing list