summaryrefslogtreecommitdiff
path: root/framework/backends
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2016-01-05 15:09:50 -0800
committerDylan Baker <baker.dylan.c@gmail.com>2016-01-07 15:35:25 -0800
commitd1bdd2bcb28860bfbccce79195e6bbb33101de2c (patch)
tree93518a41b892d8f7fc552db90774cabbfd1466ac /framework/backends
parent8cdcdf757da87fe94bde5bcc3b18ca7d46e8433f (diff)
framework: record pid of test process in results
This information can be used on linux in conjunction with scripts to associate information in dmesg with information in piglit results. Adds the pid information to both the json and junit backends, and adds tests for both. This information is not published into any of the summary modes on purpose. It's usefulness is limited to the system on which the test was ran, and only while a log of dmesg exists. v2: - remove extra newline in junit stderr (Mark) Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Diffstat (limited to 'framework/backends')
-rw-r--r--framework/backends/junit.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/framework/backends/junit.py b/framework/backends/junit.py
index 15c6c0b4e..8eb6173c2 100644
--- a/framework/backends/junit.py
+++ b/framework/backends/junit.py
@@ -212,8 +212,8 @@ class JUnitBackend(FileBackend):
# Add stderr
err = etree.SubElement(element, 'system-err')
err.text = data.err
- err.text += '\n\nstart time: {}\nend time: {}\n'.format(
- data.time.start, data.time.end)
+ err.text += '\n\npid: {}\nstart time: {}\nend time: {}\n'.format(
+ data.pid, data.time.start, data.time.end)
calculate_result()
else:
etree.SubElement(element, 'failure', message='Incomplete run.')
@@ -267,14 +267,18 @@ def _load(results_file):
result.command = out[0]
result.out = '\n'.join(out[1:])
- # Try to get the values in stderr for time
- if 'time start' in result.err:
- for line in result.err.split('\n'):
- if line.startswith('time start:'):
- result.time.start = float(line[len('time start: '):])
- elif line.startswith('time end:'):
- result.time.end = float(line[len('time end: '):])
- break
+ # Try to get the values in stderr for time and pid
+ for line in result.err.split('\n'):
+ if line.startswith('time start:'):
+ result.time.start = float(line[len('time start: '):])
+ continue
+ elif line.startswith('time end:'):
+ result.time.end = float(line[len('time end: '):])
+ continue
+ elif line.startswith('pid:'):
+ result.pid = int(line[len('pid: '):])
+ continue
+
run_result.tests[name] = result