[Piglit] [PATCH 1/4] Fixed glsl test parsing so that each key entry uses the / char instead of \\.

Jose Fonseca jfonseca at vmware.com
Wed Jul 11 14:45:16 PDT 2012



----- Original Message -----
> ---
>  framework/glsl_parser_test.py |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/framework/glsl_parser_test.py
> b/framework/glsl_parser_test.py
> index 0d97986..f346531 100755
> --- a/framework/glsl_parser_test.py
> +++ b/framework/glsl_parser_test.py
> @@ -33,6 +33,7 @@ usage_message = "usage: glsl_parser_test.py
> TEST_FILE"
>  
>  import ConfigParser
>  import os
> +import platform
>  import os.path as path
>  import re
>  import subprocess
> @@ -75,6 +76,9 @@ def import_glsl_parser_tests(group, basepath,
> subdirectories):
>  					testname = os.path.relpath(
>  						filepath, basepath)
>  					assert isinstance(testname, basestring)
> +					# Correct Test path if on windows
> +					if(platform.system() is 'Windows'):
> +						testname = testname.replace('\\','/',-1)

Instead of checking for windows I'd simply do:

  if os.path.sep != '/':
     testname = testname.replace(os.path.sep, '/', -1)

This would be more generic/future proof.

Jose

>  					add_glsl_parser_test(
>  						group,
>  						filepath,
> --
> 1.7.9.5
> 
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
> 


More information about the Piglit mailing list