Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Charles Burton
Gaudi
Commits
a312c443
Commit
a312c443
authored
Apr 01, 2016
by
Marco Clemencic
Browse files
add cpuinfo to the test annotations generated by CTestXML2HTML
parent
67974c92
Changes
1
Hide whitespace changes
Inline
Side-by-side
GaudiPolicy/scripts/CTestXML2HTML
View file @
a312c443
...
...
@@ -385,6 +385,32 @@ class TestOrganizer :
return
None
def
get_cpuinfo
():
'''
Return the CPU information of the machine as a list of dictionaries.
Only Linux is supported.
'''
cpuinfo
=
[]
try
:
current
=
{}
for
l
in
open
(
'/proc/cpuinfo'
):
try
:
k
,
v
=
map
(
str
.
strip
,
l
.
split
(
':'
,
1
))
if
k
==
'processor'
:
current
=
{
k
:
v
}
cpuinfo
.
append
(
current
)
elif
k
==
'flags'
:
current
[
k
]
=
v
.
split
()
else
:
current
[
k
]
=
v
except
ValueError
:
pass
# ignore lines without a ':'
except
IOError
:
pass
# ignore missing /proc/cpuinfo
return
cpuinfo
def
updateAnnotations
(
site
,
Testing
,
outputTemp
,
annotationsList
):
"""
Update the global annotation file with the data of the current test.
...
...
@@ -418,6 +444,16 @@ def updateAnnotations(site,Testing,outputTemp,annotationsList):
annotations
[
"qmtest.run.username"
]
=
cleanWebChar
(
site
.
get
(
"qmtest.run.username"
))
if
site
.
get
(
"qmtest.run.command_line"
)
is
not
None
:
annotations
[
"qmtest.run.command_line"
]
=
[
cleanWebChar
(
site
.
get
(
"qmtest.run.command_line"
))]
# FIXME: we assume the conversion is run on the same machine as the test
cpuinfo
=
get_cpuinfo
()
if
cpuinfo
:
annotations
[
'cpuinfo'
]
=
[
'ncpus: {0}'
.
format
(
len
(
cpuinfo
)),
'model name: {0}'
.
format
(
cpuinfo
[
0
][
'model name'
]),
'flags: {0}'
.
format
(
' '
.
join
(
cpuinfo
[
0
][
'flags'
])),
]
else
:
annotations
=
annotationsList
.
pop
(
0
)
#update the start time
...
...
Write
Preview
Supports
Markdown
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