[Piglit] [PATCH 3/4] Fix import_glsl_parser_tests' dependency on the number of dirs in basepath.

Kenneth Graunke kenneth at whitecape.org
Tue Aug 9 23:18:02 PDT 2011


On 08/08/2011 02:15 PM, Paul Berry wrote:
> To figure out where a test file belongs in the test hierarchy,
> import_glsl_parser_tests has to determine the test file's path
> relative to the "basepath" argument.
> 
> Before this patch, it worked out the relative path by dropping the
> first three directories from the test file's path.  This worked
> because import_glsl_parser_tests was always called with a basepath
> that contained exactly three directory names, e.g. "./spec/glsl-1.00".
> But it was a fragile assumption.
> 
> This patch changes import_glsl_parser_tests so that it uses
> os.path.relpath() to work out the relative path.
> 
> I've also taken the liberty of fixing a typo in the docstring
> explaining how basebath is used, and I've changed
> "assert(type(testname) is str)" to "assert isinstance(testname,
> basestring)", which works properly with Unicode.
> ---
>  framework/glsl_parser_test.py |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>



More information about the Piglit mailing list