From d271d245e97da5fef642c0f106abe3fd948c2270 Mon Sep 17 00:00:00 2001 From: "epoger@google.com" Date: Wed, 13 Feb 2013 18:14:48 +0000 Subject: gm: Add ability to compare against checksums (as opposed to image files) Review URL: https://codereview.appspot.com/7306071 git-svn-id: http://skia.googlecode.com/svn/trunk@7724 2bbb7eff-a529-9590-31e7-b0007b416f81 --- .../output-expected/command_line | 1 + .../output-expected/json-summary.txt | 25 ++++++++++++++++++++++ .../output-expected/return_value | 1 + .../output-expected/stdout | 3 +++ .../output-expected/command_line | 1 + .../output-expected/json-summary.txt | 25 ++++++++++++++++++++++ .../output-expected/return_value | 1 + .../output-expected/stdout | 3 +++ .../output-expected/command_line | 1 + .../output-expected/json-summary.txt | 25 ++++++++++++++++++++++ .../output-expected/return_value | 1 + .../output-expected/stdout | 3 +++ gm/tests/run.sh | 3 +++ 13 files changed, 93 insertions(+) create mode 100644 gm/tests/outputs/compared-against-different-pixels-json/output-expected/command_line create mode 100644 gm/tests/outputs/compared-against-different-pixels-json/output-expected/json-summary.txt create mode 100644 gm/tests/outputs/compared-against-different-pixels-json/output-expected/return_value create mode 100644 gm/tests/outputs/compared-against-different-pixels-json/output-expected/stdout create mode 100644 gm/tests/outputs/compared-against-identical-bytes-json/output-expected/command_line create mode 100644 gm/tests/outputs/compared-against-identical-bytes-json/output-expected/json-summary.txt create mode 100644 gm/tests/outputs/compared-against-identical-bytes-json/output-expected/return_value create mode 100644 gm/tests/outputs/compared-against-identical-bytes-json/output-expected/stdout create mode 100644 gm/tests/outputs/compared-against-identical-pixels-json/output-expected/command_line create mode 100644 gm/tests/outputs/compared-against-identical-pixels-json/output-expected/json-summary.txt create mode 100644 gm/tests/outputs/compared-against-identical-pixels-json/output-expected/return_value create mode 100644 gm/tests/outputs/compared-against-identical-pixels-json/output-expected/stdout (limited to 'gm/tests') diff --git a/gm/tests/outputs/compared-against-different-pixels-json/output-expected/command_line b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/command_line new file mode 100644 index 0000000000..1226cf28fc --- /dev/null +++ b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/command_line @@ -0,0 +1 @@ +out/Debug/gm --hierarchy --match dashing2 --config 8888 --config 565 -r gm/tests/inputs/json/different-pixels.json --writeJsonSummary gm/tests/outputs/compared-against-different-pixels-json/output-actual/json-summary.txt diff --git a/gm/tests/outputs/compared-against-different-pixels-json/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/json-summary.txt new file mode 100644 index 0000000000..37709e1ffc --- /dev/null +++ b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/json-summary.txt @@ -0,0 +1,25 @@ +{ + "actual-results" : { + "failed" : { + "565/dashing2" : { + "checksum" : FAKE + }, + "8888/dashing2" : { + "checksum" : FAKE + } + }, + "failure-ignored" : null, + "no-comparison" : null, + "succeeded" : null + }, + "expected-results" : { + "565/dashing2" : { + "checksums" : [ FAKE ], + "ignore-failure" : false + }, + "8888/dashing2" : { + "checksums" : [ FAKE ], + "ignore-failure" : false + } + } +} diff --git a/gm/tests/outputs/compared-against-different-pixels-json/output-expected/return_value b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/return_value new file mode 100644 index 0000000000..ace9d03621 --- /dev/null +++ b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/return_value @@ -0,0 +1 @@ +255 diff --git a/gm/tests/outputs/compared-against-different-pixels-json/output-expected/stdout b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/stdout new file mode 100644 index 0000000000..9194b40bf5 --- /dev/null +++ b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/stdout @@ -0,0 +1,3 @@ +reading expectations from JSON summary file gm/tests/inputs/json/different-pixels.json +drawing... dashing2 [640 480] +Ran 1 tests: 0 passed, 1 failed, 0 missing reference images diff --git a/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/command_line b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/command_line new file mode 100644 index 0000000000..e8fb0b97e6 --- /dev/null +++ b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/command_line @@ -0,0 +1 @@ +out/Debug/gm --hierarchy --match dashing2 --config 8888 --config 565 -r gm/tests/inputs/json/identical-bytes.json --writeJsonSummary gm/tests/outputs/compared-against-identical-bytes-json/output-actual/json-summary.txt diff --git a/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/json-summary.txt new file mode 100644 index 0000000000..bed3b2d3b4 --- /dev/null +++ b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/json-summary.txt @@ -0,0 +1,25 @@ +{ + "actual-results" : { + "failed" : null, + "failure-ignored" : null, + "no-comparison" : null, + "succeeded" : { + "565/dashing2" : { + "checksum" : FAKE + }, + "8888/dashing2" : { + "checksum" : FAKE + } + } + }, + "expected-results" : { + "565/dashing2" : { + "checksums" : [ FAKE ], + "ignore-failure" : false + }, + "8888/dashing2" : { + "checksums" : [ FAKE ], + "ignore-failure" : false + } + } +} diff --git a/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/return_value b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/return_value new file mode 100644 index 0000000000..573541ac97 --- /dev/null +++ b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/return_value @@ -0,0 +1 @@ +0 diff --git a/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/stdout b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/stdout new file mode 100644 index 0000000000..afa854c231 --- /dev/null +++ b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/stdout @@ -0,0 +1,3 @@ +reading expectations from JSON summary file gm/tests/inputs/json/identical-bytes.json +drawing... dashing2 [640 480] +Ran 1 tests: 1 passed, 0 failed, 0 missing reference images diff --git a/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/command_line b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/command_line new file mode 100644 index 0000000000..a596064846 --- /dev/null +++ b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/command_line @@ -0,0 +1 @@ +out/Debug/gm --hierarchy --match dashing2 --config 8888 --config 565 -r gm/tests/inputs/json/identical-pixels.json --writeJsonSummary gm/tests/outputs/compared-against-identical-pixels-json/output-actual/json-summary.txt diff --git a/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/json-summary.txt new file mode 100644 index 0000000000..bed3b2d3b4 --- /dev/null +++ b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/json-summary.txt @@ -0,0 +1,25 @@ +{ + "actual-results" : { + "failed" : null, + "failure-ignored" : null, + "no-comparison" : null, + "succeeded" : { + "565/dashing2" : { + "checksum" : FAKE + }, + "8888/dashing2" : { + "checksum" : FAKE + } + } + }, + "expected-results" : { + "565/dashing2" : { + "checksums" : [ FAKE ], + "ignore-failure" : false + }, + "8888/dashing2" : { + "checksums" : [ FAKE ], + "ignore-failure" : false + } + } +} diff --git a/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/return_value b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/return_value new file mode 100644 index 0000000000..573541ac97 --- /dev/null +++ b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/return_value @@ -0,0 +1 @@ +0 diff --git a/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/stdout b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/stdout new file mode 100644 index 0000000000..3b2671aad5 --- /dev/null +++ b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/stdout @@ -0,0 +1,3 @@ +reading expectations from JSON summary file gm/tests/inputs/json/identical-pixels.json +drawing... dashing2 [640 480] +Ran 1 tests: 1 passed, 0 failed, 0 missing reference images diff --git a/gm/tests/run.sh b/gm/tests/run.sh index e1b6ce7707..a90db38b2b 100755 --- a/gm/tests/run.sh +++ b/gm/tests/run.sh @@ -145,12 +145,15 @@ create_inputs_dir $GM_INPUTS # Compare generated image against an input image file with identical bytes. gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/images/identical-bytes" "$GM_OUTPUTS/compared-against-identical-bytes-images" +gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/json/identical-bytes.json" "$GM_OUTPUTS/compared-against-identical-bytes-json" # Compare generated image against an input image file with identical pixels but different PNG encoding. gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/images/identical-pixels" "$GM_OUTPUTS/compared-against-identical-pixels-images" +gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/json/identical-pixels.json" "$GM_OUTPUTS/compared-against-identical-pixels-json" # Compare generated image against an input image file with different pixels. gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/images/different-pixels" "$GM_OUTPUTS/compared-against-different-pixels-images" +gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/json/different-pixels.json" "$GM_OUTPUTS/compared-against-different-pixels-json" # Compare generated image against an empty "expected image" dir. gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/images/empty-dir" "$GM_OUTPUTS/compared-against-empty-dir" -- cgit v1.2.3