Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mesa
piglit
Commits
8900a6f0
Commit
8900a6f0
authored
Jun 30, 2008
by
Nicolai Hähnle
Browse files
piglit-summary-html.py: Some more features for automated summaries
parent
479e7c4a
Changes
3
Hide whitespace changes
Inline
Side-by-side
framework/core.py
View file @
8900a6f0
...
...
@@ -160,7 +160,7 @@ class GroupResult(dict):
class
TestrunResult
:
def
__init__
(
self
,
*
args
):
self
.
name
=
''
self
.
globalkeys
=
[
'name'
,
'glxinfo'
,
'lspci'
]
self
.
globalkeys
=
[
'name'
,
'href'
,
'glxinfo'
,
'lspci'
]
self
.
results
=
GroupResult
()
def
allTestResults
(
self
):
...
...
piglit-summary-html.py
View file @
8900a6f0
...
...
@@ -64,6 +64,7 @@ ResultMString = readfile(templatedir + 'result_mstring.html')
Index
=
readfile
(
templatedir
+
'index.html'
)
IndexTestrun
=
readfile
(
templatedir
+
'index_testrun.html'
)
IndexTestrunB
=
readfile
(
templatedir
+
'index_testrunb.html'
)
IndexTestrunBHref
=
readfile
(
templatedir
+
'index_testrunb_href.html'
)
IndexGroup
=
readfile
(
templatedir
+
'index_group.html'
)
IndexGroupTestrun
=
readfile
(
templatedir
+
'index_group_testrun.html'
)
IndexGroupGroup
=
readfile
(
templatedir
+
'index_groupgroup.html'
)
...
...
@@ -207,9 +208,15 @@ results is an array containing the top-level results dictionarys.
page
=
SummaryPages
[
to
]
return
'<a href="%(page)s">%(to)s</a>'
%
locals
()
def
testrunb
(
tr
):
if
'href'
in
tr
.
__dict__
:
return
IndexTestrunBHref
%
tr
.
__dict__
else
:
return
IndexTestrunB
%
tr
.
__dict__
group
=
buildGroupSummary
(
1
,
summary
.
root
,
showcurrent
)
testruns
=
""
.
join
([
IndexTestrun
%
tr
.
__dict__
for
tr
in
summary
.
testruns
])
testrunsb
=
""
.
join
([
IndexTestrunB
%
tr
.
__dict__
for
tr
in
summary
.
testruns
])
testrunsb
=
""
.
join
([
testrunb
(
tr
)
for
tr
in
summary
.
testruns
])
tolist
=
SummaryPages
.
keys
()
tolist
.
sort
()
...
...
@@ -229,22 +236,42 @@ Options:
-f, --full Prefer the full results over the
-h, --help Show this message
-o, --overwrite Overwrite existing directories
-l, --list=listfile Use test results from a list file
Example:
%(progName)s summary/mysum results/all.results
Example list file:
[
[ 'test.result', { name: 'override-name' } ],
[ 'other.result' ]
]
"""
print
USAGE
%
{
'progName'
:
sys
.
argv
[
0
]}
sys
.
exit
(
1
)
def
parse_listfile
(
filename
):
file
=
open
(
filename
,
"r"
)
code
=
""
.
join
([
s
for
s
in
file
])
file
.
close
()
return
eval
(
code
)
def
loadresult
(
descr
,
OptionPreferSummary
):
result
=
core
.
loadTestResults
(
descr
[
0
],
OptionPreferSummary
)
if
len
(
descr
)
>
1
:
result
.
__dict__
.
update
(
descr
[
1
])
return
result
def
main
():
try
:
options
,
args
=
getopt
(
sys
.
argv
[
1
:],
"hof"
,
[
"help"
,
"overwrite"
,
"full"
])
options
,
args
=
getopt
(
sys
.
argv
[
1
:],
"hof
l:
"
,
[
"help"
,
"overwrite"
,
"full"
,
"list"
])
except
GetoptError
:
usage
()
OptionOverwrite
=
False
OptionPreferSummary
=
True
OptionList
=
[]
for
name
,
value
in
options
:
if
name
==
"-h"
or
name
==
"--help"
:
usage
()
...
...
@@ -252,16 +279,18 @@ def main():
OptionOverwrite
=
True
elif
name
==
"-f"
or
name
==
"--full"
:
OptionPreferSummary
=
False
elif
name
==
"-l"
or
name
==
"--list"
:
OptionList
+=
parse_listfile
(
value
)
OptionList
+=
[[
name
]
for
name
in
args
[
1
:]]
if
len
(
args
)
<
2
:
if
len
(
args
)
<
1
or
len
(
OptionList
)
==
0
:
usage
()
summaryDir
=
args
[
0
]
resultFilenames
=
args
[
1
:]
core
.
checkDir
(
summaryDir
,
not
OptionOverwrite
)
results
=
[
core
.
loadTestResults
(
name
,
OptionPreferSummary
)
for
name
in
resultFilenames
]
results
=
[
loadresult
(
descr
,
OptionPreferSummary
)
for
descr
in
OptionList
]
summary
=
framework
.
summary
.
Summary
(
results
)
for
j
in
range
(
len
(
summary
.
testruns
)):
...
...
templates/index_testrunb_href.html
0 → 100644
View file @
8900a6f0
<td
class=
"head"
><b><a
href=
"%(href)s"
>
%(name)s
</a></b></td>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment