On Thursday, September 04, 2014 10:49:10 PM Emil Velikov wrote:
> On 04/09/14 21:54, Dylan Baker wrote:
> > This solves the bug of running piglit run -n 'wip/foo' which causes a
> > number of issues in the html summary generation.
> > 
> From a quick look it seems that it might help with a funny issue that I'm 
> seeing:
> 
> Whenever piglit is ran on Windows the testname uses \\ as path separator (in
> some cases / is also used). When trying to generate summary under Linux, the
> script ends up generating a ton of spec\extenstion_name\test files, rather
> than structuring everything as normal.

The mixed '/' and '\\' issue is known, it's mostly due to hard coding of
values. It's on my list (although pretty far down) of things to fix.

> 
> Am I imagining or this will bring all the segfaults in bash to an end ?

I've never heard of this. Although I use zsh, so I guess that's not
surprising.

> 
> Thanks
> Emil
> 
> > CC: Jason Ekstrand <ja...@jlekstrand.net>
> > Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> > ---
> >  framework/summary.py | 14 ++++++++++----
> >  1 file changed, 10 insertions(+), 4 deletions(-)
> > 
> > diff --git a/framework/summary.py b/framework/summary.py
> > index d1b737b..debd6a7 100644
> > --- a/framework/summary.py
> > +++ b/framework/summary.py
> > @@ -47,6 +47,11 @@ def escape_filename(key):
> >      return re.sub(r'[<>:"|?*#]', '_', key)
> >  
> >  
> > +def escape_pathname(key):
> > +    """ Remove / and \\ from names """
> > +    return re.sub(r'[/\\]', '_', key)
> > +
> > +
> >  def normalize_href(href):
> >      """Force backward slashes in URLs."""
> >      return href.replace('\\', '/')
> > @@ -113,7 +118,7 @@ class HTMLIndex(list):
> >          self._newRow()
> >          self.append({'type': 'other', 'text': '<td />'})
> >          for each in summary.results:
> > -            href = posixpath.join(each.name, "index.html")
> > +            href = posixpath.join(escape_pathname(each.name), "index.html")
> >              href = normalize_href(href)
> >              self.append({'type': 'other',
> >                           'text': '<td class="head"><b>%(name)s</b><br />'
> > @@ -454,7 +459,8 @@ class Summary:
> >  
> >          # Iterate across the tests creating the various test specific files
> >          for each in self.results:
> > -            os.mkdir(path.join(destination, each.name))
> > +            name = escape_pathname(each.name)
> > +            os.mkdir(path.join(destination, name))
> >  
> >              if each.time_elapsed is not None:
> >                  time = datetime.timedelta(0, each.time_elapsed)
> > @@ -463,7 +469,7 @@ class Summary:
> >  
> >              self.__find_totals(each)
> >  
> > -            with open(path.join(destination, each.name, "index.html"), 
> > 'w') as out:
> > +            with open(path.join(destination, name, "index.html"), 'w') as 
> > out:
> >                  out.write(testindex.render(name=each.name,
> >                                             totals=self.totals,
> >                                             time=time,
> > @@ -474,7 +480,7 @@ class Summary:
> >  
> >              # Then build the individual test results
> >              for key, value in each.tests.iteritems():
> > -                html_path = path.join(destination, each.name, 
> > escape_filename(key + ".html"))
> > +                html_path = path.join(destination, name, 
> > escape_filename(key + ".html"))
> >                  temp_path = path.dirname(html_path)
> >  
> >                  if value['result'] not in exclude:
> > 
> 

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to