[Piglit] [PATCH] glslparsertest: Fix handling of --check-link option

Ian Romanick idr at freedesktop.org
Wed Aug 28 14:31:18 PDT 2013


From: Ian Romanick <ian.d.romanick at intel.com>

The code in the PIGLIT_GL_TEST_CONFIG_BEGIN block assumes that various
command line parameters will be at specific locations.  However, if
--check-link is used, these locations will be off by one.  Process the
command line options in the PIGLIT_GL_TEST_CONFIG_BEGIN block to avoid
this problem.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: Kenneth Graunke <kenneth at whitecape.org>
---
 tests/glslparsertest/glslparsertest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/glslparsertest/glslparsertest.c b/tests/glslparsertest/glslparsertest.c
index d9f1947..170dbad 100644
--- a/tests/glslparsertest/glslparsertest.c
+++ b/tests/glslparsertest/glslparsertest.c
@@ -39,6 +39,7 @@ static unsigned parse_glsl_version_number(const char *str);
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
+	argc = process_options(argc, argv);
 	if (argc > 3) {
 		const unsigned int int_version
 			= parse_glsl_version_number(argv[3]);
@@ -408,7 +409,6 @@ piglit_init(int argc, char**argv)
 	unsigned glsl_version = 0;
 	int i;
 
-	argc = process_options(argc, argv);
 	if (argc < 3)
 		usage(argv[0]);
 
-- 
1.8.1.4



More information about the Piglit mailing list