Commit a312c443 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

add cpuinfo to the test annotations generated by CTestXML2HTML

parent 67974c92
......@@ -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 = []
current = {}
for l in open('/proc/cpuinfo'):
k, v = map(str.strip, l.split(':', 1))
if k == 'processor':
current = {k: v}
elif k == 'flags':
current[k] = v.split()
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[""] = cleanWebChar(site.get(""))
if site.get("") is not None:
annotations[""] = [cleanWebChar(site.get(""))]
# 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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment