summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorAndres Gomez <agomez@igalia.com>2020-12-06 02:26:05 +0200
committerAndres Gomez <agomez@igalia.com>2020-12-17 22:33:42 +0200
commite8747f0c1677c292090b76967cdea959dc061f58 (patch)
tree10e2aba062bea6d19f26d298cfae7720c82a67b6 /framework
parent859b32a97280b0722d04f5f90cd94d0b1392304c (diff)
framework/replay: add always the images information to the results
We were adding the images only when the comparison failed. We would rather have the available information in any case. Signed-off-by: Andres Gomez <agomez@igalia.com> Acked-by: Eric Anholt <eric@anholt.net> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Part-of: <https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/426>
Diffstat (limited to 'framework')
-rw-r--r--framework/replay/compare_replay.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/framework/replay/compare_replay.py b/framework/replay/compare_replay.py
index 287ddaa18..cd4156d8c 100644
--- a/framework/replay/compare_replay.py
+++ b/framework/replay/compare_replay.py
@@ -96,7 +96,13 @@ def _check_trace(trace_path, expected_checksum):
' actual: {}\n'
' expected: {}'.format(checksum or 'error', expected_checksum))
+ json_result['images'] = [
+ {'image_desc': trace_path,
+ 'image_ref': expected_checksum + '.png',
+ 'image_render': expected_checksum + '.png'}]
+
if checksum is None:
+ json_result['images'][0]['image_render'] = None
return Result.FAILURE, json_result
if checksum == expected_checksum:
@@ -109,17 +115,13 @@ def _check_trace(trace_path, expected_checksum):
print('[check_image] For more information see '
'https://gitlab.freedesktop.org/'
'mesa/piglit/blob/master/replayer/README.md\n')
- json_result['images'] = [
- {'image_desc': trace_path,
- 'image_ref': expected_checksum + '.png'}]
result = Result.DIFFER
if result is not Result.MATCH or OPTIONS.keep_image:
root, ext = path.splitext(image_file)
image_file_dest = '{}-{}{}'.format(root, checksum, ext)
shutil.move(image_file, image_file_dest)
- if 'images' in json_result:
- json_result['images'][0]['image_render'] = image_file_dest
+ json_result['images'][0]['image_render'] = image_file_dest
return result, json_result