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

Emil Velikov emil.l.velikov at gmail.com
Fri Nov 21 20:49:31 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.

Cc: Dylan Baker <dylanx.c.baker at intel.com>
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 framework/summary.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/summary.py b/framework/summary.py
index f4fd80d..6dc2b07 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -482,7 +482,7 @@ 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"))
+                html_path = path.join(destination, name, escape_filename(key.replace('\\', '/') + ".html"))
                 temp_path = path.dirname(html_path)
 
                 if value['result'] not in exclude:
-- 
2.1.3



More information about the Piglit mailing list