[Piglit] [PATCH] summary.py: escape \ from Windows results when creating folders on Linux

Jose Fonseca jfonseca at vmware.com
Sun Nov 23 01:46:36 PST 2014


On 22/11/14 19:36, Emil Velikov wrote:
> Seemingly this is sufficient for a Windows piglit run/result file to be
> ran under Linux and the correct directory structure (and html) to be
> generated.
>
> Unfortunately my python-fu is a bit short so I'm not sure if(how much)
> this will backfire when used on Windows with either Linux or Windows
> result file.
>
> v2: Attempt to handle Linux results on Windows.

I think v2 is not necessary. '/' should work just fine. But without 
testing I can't claim I'm sure.

Jose

>
> Cc: Dylan Baker <dylanx.c.baker at intel.com>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
>   framework/summary.py | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/framework/summary.py b/framework/summary.py
> index f4fd80d..1bb5297 100644
> --- a/framework/summary.py
> +++ b/framework/summary.py
> @@ -482,8 +482,8 @@ class Summary:
>
>               # Then build the individual test results
>               for key, value in each.tests.iteritems():
> -                html_path = path.join(destination, name, escape_filename(key + ".html"))
> -                temp_path = path.dirname(html_path)
> +                html_path = path.join(destination, name, escape_filename(key.replace('\\', '/') + ".html"))
> +                temp_path = path.dirname(html_path.replace('/', os.sep))
>
>                   if value['result'] not in exclude:
>                       # os.makedirs is very annoying, it throws an OSError if
>



More information about the Piglit mailing list