[Piglit] [PATCH piglit] Don't add slash to the start of HREFs of individual test results.

Matěj Cepl mcepl at redhat.com
Tue Oct 4 10:39:40 PDT 2011


Otherwise the browser thinks they are in the root of the current
hierarchy, whereas they are in the same folder as index.html.

Signed-off-by: Matěj Cepl <mcepl at redhat.com>
---
 piglit-summary-html.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/piglit-summary-html.py b/piglit-summary-html.py
index 6e5082c..a255a15 100755
--- a/piglit-summary-html.py
+++ b/piglit-summary-html.py
@@ -148,6 +148,12 @@ def writeTestrunHtml(testrun, filename):
 
 	writefile(filename, Testrun % locals())
 
+def hrefFromParts(codename, path):
+	outStr = codename + '/' + testPathToHtmlFilename(path)
+	if outStr[0] == '/':
+		outStr = outStr[1:]
+	return outStr
+
 def buildTestSummary(indent, alternate, testsummary):
 	tenindent = 10 - indent
 	path = testsummary.path
@@ -155,7 +161,7 @@ def buildTestSummary(indent, alternate, testsummary):
 	testruns = "".join([IndexTestTestrun % {
 		'alternate': alternate,
 		'status': result.status,
-		'link': result.testrun.codename + '/' + testPathToHtmlFilename(path)
+		'link': hrefFromParts(result.testrun.codename, path)
 	} for result in testsummary.results])
 
 	return IndexTest % locals()
-- 
1.7.6.4



More information about the Piglit mailing list