summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2015-09-11 14:32:25 -0700
committerDylan Baker <baker.dylan.c@gmail.com>2015-09-22 14:45:49 -0700
commite08ff27effd85c0bf50a914b31b9d9f73a7e76ea (patch)
treeb47d8e63649e867a07313cae4a55750fce71e24d /framework
parente338988e69e1fa3c6b0a22dac68f1807c387a791 (diff)
framework/backends.json.py: use TestrunResult.from_dict for resume
This simplifies the code considerably, and removes the need to manually calculate the group totals (since from_dict handles that for us) Signed-off-by: <dylanx.c.baker@intel.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/backends/json.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/framework/backends/json.py b/framework/backends/json.py
index 353042227..935480b79 100644
--- a/framework/backends/json.py
+++ b/framework/backends/json.py
@@ -251,26 +251,17 @@ def _resume(results_dir):
assert meta['results_version'] == CURRENT_JSON_VERSION, \
"Old results version, resume impossible"
- testrun = results.TestrunResult()
- testrun.name = meta['name']
- testrun.options = meta['options']
- testrun.uname = meta.get('uname')
- testrun.glxinfo = meta.get('glxinfo')
- testrun.lspci = meta.get('lspci')
-
- set_meta(testrun)
+ meta['tests'] = {}
# Load all of the test names and added them to the test list
for file_ in os.listdir(os.path.join(results_dir, 'tests')):
with open(os.path.join(results_dir, 'tests', file_), 'r') as f:
try:
- testrun.tests.update(json.load(f, object_hook=piglit_decoder))
+ meta['tests'].update(json.load(f, object_hook=piglit_decoder))
except ValueError:
continue
- testrun.calculate_group_totals()
-
- return testrun
+ return results.TestrunResult.from_dict(meta)
def _update_results(results, filepath):