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

Emil Velikov emil.l.velikov at gmail.com
Sat Nov 22 11:36:22 PST 2014


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.

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
-- 
2.1.3



More information about the Piglit mailing list