diff options
author | epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-12-05 20:21:35 +0000 |
---|---|---|
committer | epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-12-05 20:21:35 +0000 |
commit | 8a6f13a20ddcf5c33157a34602a074d366f9918e (patch) | |
tree | 154529e8ebbcfab47f0e2f06ff6f52691479132e /gm | |
parent | dbbca9a4048d1871ca538fc2a2e8e4b624e877de (diff) |
Add script to help rebaseline gm self-tests, and run it right now
BUG=https://code.google.com/p/skia/issues/detail?id=995
TBR=rmistry
Review URL: https://codereview.appspot.com/6887046
git-svn-id: http://skia.googlecode.com/svn/trunk@6683 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm')
12 files changed, 46 insertions, 8 deletions
diff --git a/gm/tests/inputs/different-pixels/8888/dashing2.png b/gm/tests/inputs/different-pixels/8888/dashing2.png Binary files differnew file mode 100644 index 0000000000..3a0bc2e902 --- /dev/null +++ b/gm/tests/inputs/different-pixels/8888/dashing2.png diff --git a/gm/tests/inputs/identical-bytes/8888/dashing2.png b/gm/tests/inputs/identical-bytes/8888/dashing2.png Binary files differnew file mode 100644 index 0000000000..465c0199df --- /dev/null +++ b/gm/tests/inputs/identical-bytes/8888/dashing2.png diff --git a/gm/tests/inputs/identical-pixels/8888/dashing2.png b/gm/tests/inputs/identical-pixels/8888/dashing2.png Binary files differnew file mode 100644 index 0000000000..2d05b01b01 --- /dev/null +++ b/gm/tests/inputs/identical-pixels/8888/dashing2.png diff --git a/gm/tests/outputs/compared-against-different-pixels/output-expected/command_line b/gm/tests/outputs/compared-against-different-pixels/output-expected/command_line index 1bcbead0e0..ef8c5afda4 100644 --- a/gm/tests/outputs/compared-against-different-pixels/output-expected/command_line +++ b/gm/tests/outputs/compared-against-different-pixels/output-expected/command_line @@ -1 +1 @@ -out/Debug/gm --hierarchy --match dashing2 --config 4444 -r gm/tests/inputs/different-pixels -w gm/tests/outputs/compared-against-different-pixels/output-actual/images +out/Debug/gm --hierarchy --match dashing2 --config 8888 -r gm/tests/inputs/different-pixels -w gm/tests/outputs/compared-against-different-pixels/output-actual/images diff --git a/gm/tests/outputs/compared-against-different-pixels/output-expected/images/8888/dashing2.png b/gm/tests/outputs/compared-against-different-pixels/output-expected/images/8888/dashing2.png Binary files differnew file mode 100644 index 0000000000..465c0199df --- /dev/null +++ b/gm/tests/outputs/compared-against-different-pixels/output-expected/images/8888/dashing2.png diff --git a/gm/tests/outputs/compared-against-different-pixels/output-expected/stdout b/gm/tests/outputs/compared-against-different-pixels/output-expected/stdout index 1eda31c7db..3833cbe714 100644 --- a/gm/tests/outputs/compared-against-different-pixels/output-expected/stdout +++ b/gm/tests/outputs/compared-against-different-pixels/output-expected/stdout @@ -1,6 +1,6 @@ reading from gm/tests/inputs/different-pixels writing to gm/tests/outputs/compared-against-different-pixels/output-actual/images drawing... dashing2 [640 480] ------ max pixel mismatch for 4444/dashing2 is 51 +----- max pixel mismatch for 8888/dashing2 is 51 Ran 1 tests: 0 passed, 1 failed, 0 missing reference images - 4444/dashing2 pixel_error 51 + 8888/dashing2 pixel_error 51 diff --git a/gm/tests/outputs/compared-against-identical-bytes/output-expected/command_line b/gm/tests/outputs/compared-against-identical-bytes/output-expected/command_line index c70d01dc8c..6e89999781 100644 --- a/gm/tests/outputs/compared-against-identical-bytes/output-expected/command_line +++ b/gm/tests/outputs/compared-against-identical-bytes/output-expected/command_line @@ -1 +1 @@ -out/Debug/gm --hierarchy --match dashing2 --config 4444 -r gm/tests/inputs/identical-bytes -w gm/tests/outputs/compared-against-identical-bytes/output-actual/images +out/Debug/gm --hierarchy --match dashing2 --config 8888 -r gm/tests/inputs/identical-bytes -w gm/tests/outputs/compared-against-identical-bytes/output-actual/images diff --git a/gm/tests/outputs/compared-against-identical-bytes/output-expected/images/8888/dashing2.png b/gm/tests/outputs/compared-against-identical-bytes/output-expected/images/8888/dashing2.png Binary files differnew file mode 100644 index 0000000000..465c0199df --- /dev/null +++ b/gm/tests/outputs/compared-against-identical-bytes/output-expected/images/8888/dashing2.png diff --git a/gm/tests/outputs/compared-against-identical-pixels/output-expected/command_line b/gm/tests/outputs/compared-against-identical-pixels/output-expected/command_line index d6b58501d6..285cef2125 100644 --- a/gm/tests/outputs/compared-against-identical-pixels/output-expected/command_line +++ b/gm/tests/outputs/compared-against-identical-pixels/output-expected/command_line @@ -1 +1 @@ -out/Debug/gm --hierarchy --match dashing2 --config 4444 -r gm/tests/inputs/identical-pixels -w gm/tests/outputs/compared-against-identical-pixels/output-actual/images +out/Debug/gm --hierarchy --match dashing2 --config 8888 -r gm/tests/inputs/identical-pixels -w gm/tests/outputs/compared-against-identical-pixels/output-actual/images diff --git a/gm/tests/outputs/compared-against-identical-pixels/output-expected/images/8888/dashing2.png b/gm/tests/outputs/compared-against-identical-pixels/output-expected/images/8888/dashing2.png Binary files differnew file mode 100644 index 0000000000..465c0199df --- /dev/null +++ b/gm/tests/outputs/compared-against-identical-pixels/output-expected/images/8888/dashing2.png diff --git a/gm/tests/rebaseline.sh b/gm/tests/rebaseline.sh new file mode 100755 index 0000000000..77f8711e18 --- /dev/null +++ b/gm/tests/rebaseline.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Rebaseline the outputs/*/output-expected/ subdirectories used by the +# gm self-tests. +# Use with caution: are you sure the new results are actually correct? +# +# YOU MUST RE-RUN THIS UNTIL THE SELF-TESTS SUCCEED! +# (It takes one run for each call to gm_test in run.sh) + +# cd into the gm self-test dir +cd $(dirname $0) + +./run.sh + +# Delete all the expected output files +EXPECTED_FILES=$(find outputs/*/output-expected -type f | grep -v /\.svn/) +for EXPECTED_FILE in $EXPECTED_FILES; do + rm $EXPECTED_FILE +done + +# Copy all the actual output files into the "expected" directories, +# creating new subdirs as we go. +ACTUAL_FILES=$(find outputs/*/output-actual -type f | grep -v /\.svn/) +for ACTUAL_FILE in $ACTUAL_FILES; do + EXPECTED_FILE=${ACTUAL_FILE//actual/expected} + mkdir -p $(dirname $EXPECTED_FILE) + cp $ACTUAL_FILE $EXPECTED_FILE +done + +# "svn add" any newly expected files/dirs, and "svn rm" any that are gone now +FILES=$(svn stat outputs/*/output-expected | grep ^\? | awk '{print $2}') +for FILE in $FILES; do + svn add $FILE +done +FILES=$(svn stat outputs/*/output-expected | grep ^\! | awk '{print $2}') +for FILE in $FILES; do + svn rm $FILE +done diff --git a/gm/tests/run.sh b/gm/tests/run.sh index acf4b5feef..b97b28904b 100755 --- a/gm/tests/run.sh +++ b/gm/tests/run.sh @@ -64,12 +64,12 @@ GM_INPUTS=$GM_TESTDIR/inputs GM_OUTPUTS=$GM_TESTDIR/outputs # Compare generated image against an input image file with identical bytes. -gm_test "--hierarchy --match dashing2 --config 4444 -r $GM_INPUTS/identical-bytes" "$GM_OUTPUTS/compared-against-identical-bytes" +gm_test "--hierarchy --match dashing2 --config 8888 -r $GM_INPUTS/identical-bytes" "$GM_OUTPUTS/compared-against-identical-bytes" # Compare generated image against an input image file with identical pixels but different PNG encoding. -gm_test "--hierarchy --match dashing2 --config 4444 -r $GM_INPUTS/identical-pixels" "$GM_OUTPUTS/compared-against-identical-pixels" +gm_test "--hierarchy --match dashing2 --config 8888 -r $GM_INPUTS/identical-pixels" "$GM_OUTPUTS/compared-against-identical-pixels" # Compare generated image against an input image file with different pixels. -gm_test "--hierarchy --match dashing2 --config 4444 -r $GM_INPUTS/different-pixels" "$GM_OUTPUTS/compared-against-different-pixels" +gm_test "--hierarchy --match dashing2 --config 8888 -r $GM_INPUTS/different-pixels" "$GM_OUTPUTS/compared-against-different-pixels" echo "All tests passed." |