summaryrefslogtreecommitdiff
path: root/framework/backends
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2015-08-25 15:44:03 -0700
committerDylan Baker <baker.dylan.c@gmail.com>2015-09-22 14:45:48 -0700
commitd860fb6f83ab64a99591c8a93d7931d19addb376 (patch)
treebee52920a948075b0531736c9aa45f43adb4797c /framework/backends
parent95b2699972ab07d87d6a67fa90351db63a0912be (diff)
framework/results.py: Add a to_json method to the TestrunResults
The piglit_encoder knows how to convert an object with a to_json method into it's json representation. By using this approach we can add special hints to the json for converting it back into it's python object representation, which can also be removed easily by using a from* method. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'framework/backends')
-rw-r--r--framework/backends/json.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/framework/backends/json.py b/framework/backends/json.py
index e88c9c881..fc816f726 100644
--- a/framework/backends/json.py
+++ b/framework/backends/json.py
@@ -326,10 +326,7 @@ def _update_results(results, filepath):
def _write(results, file_):
"""WRite the values of the results out to a file."""
with write_compressed(file_) as f:
- json.dump({k: v for k, v in results.__dict__.iteritems()},
- f,
- default=piglit_encoder,
- indent=INDENT)
+ json.dump(results, f, default=piglit_encoder, indent=INDENT)
def _update_zero_to_one(result):