diff options
author | rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-03 19:23:22 +0000 |
---|---|---|
committer | rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-03 19:23:22 +0000 |
commit | ee5a5eee12b3befac33ed6c379f81bf749f57161 (patch) | |
tree | 990692877cec0035f44d4eccdf75f61fbe41df5d /tools/tests | |
parent | 57cf9a6f252528ca54a2daac2b0064ce95405c09 (diff) |
* Extended skdiff to report alpha channel differences.
* Created a tools/tests/rebaseline.sh to copy output-actual into output-expected.
* Sample results are available here: http://www.corp.google.com/~rmistry/skia/gm-playback-windows/images-skdiff/
Review URL: https://codereview.appspot.com/7038048
git-svn-id: http://skia.googlecode.com/svn/trunk@7003 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools/tests')
-rwxr-xr-x | tools/tests/rebaseline.sh | 73 | ||||
-rw-r--r-- | tools/tests/skdiff/test1/output-expected/index.html | 4 |
2 files changed, 75 insertions, 2 deletions
diff --git a/tools/tests/rebaseline.sh b/tools/tests/rebaseline.sh new file mode 100755 index 0000000000..eee8db87c1 --- /dev/null +++ b/tools/tests/rebaseline.sh @@ -0,0 +1,73 @@ +#!/bin/bash + +# Rebaseline the skdiff/*/output-expected/ subdirectories used by the skdiff +# self-tests. +# Use with caution: are you sure the new results are actually correct? +# +# YOU MUST RE-RUN THIS UNTIL THE SELF-TESTS SUCCEED! +# +# TODO: currently, this must be run on Linux to generate baselines that match +# the ones on the housekeeper bot (which runs on Linux... see +# http://70.32.156.51:10117/builders/Skia_PerCommit_House_Keeping/builds/1417/steps/RunGmSelfTests/logs/stdio ) +# See https://code.google.com/p/skia/issues/detail?id=677 +# ('make tools/tests/run.sh work cross-platform') + +function replace_expected_with_actual { + # Delete all the expected output files + EXPECTED_FILES=$(find skdiff/*/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 skdiff/*/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 +} + +function svn_add_new_files { + # Delete all the "actual" directories, so we can svn-add any new "expected" + # directories without adding the "actual" ones. + rm -rf skdiff/*/output-actual + FILES=$(svn stat skdiff/* | grep ^\? | awk '{print $2}') + for FILE in $FILES; do + svn add $FILE + done + FILES=$(svn stat skdiff/*/output-expected | grep ^\? | awk '{print $2}') + for FILE in $FILES; do + svn add $FILE + done +} + +function svn_delete_old_files { + FILES=$(svn stat skdiff/*/output-expected | grep ^\! | awk '{print $2}') + for FILE in $FILES; do + svn rm $FILE + done + FILES=$(svn stat skdiff/* | grep ^\! | awk '{print $2}') + for FILE in $FILES; do + svn rm $FILE + done +} + + +# cd into the gm self-test dir +cd $(dirname $0) + +./run.sh +SELFTEST_RESULT=$? +echo +if [ "$SELFTEST_RESULT" != "0" ]; then + replace_expected_with_actual + echo "Self-tests still failing, you should probably run this again..." +else + svn_add_new_files + svn_delete_old_files + echo "Self-tests succeeded this time, you should be done!" +fi +exit $SELFTEST_RESULT + diff --git a/tools/tests/skdiff/test1/output-expected/index.html b/tools/tests/skdiff/test1/output-expected/index.html index a3e192e482..4bf8eee402 100644 --- a/tools/tests/skdiff/test1/output-expected/index.html +++ b/tools/tests/skdiff/test1/output-expected/index.html @@ -39,10 +39,10 @@ $("#checkedList").html(fileCmdLineString + '<br><br>' + fileMultiLineString); <td><input type="checkbox" name="different-bits/very-different-sizes.png" checked="yes"></td><td><b>different-bits/very-different-sizes.png</b><br>Image sizes differ</td><td>N/A</td><td>N/A</td><td><a href="../../../../../tools/tests/skdiff/baseDir/different-bits/very-different-sizes.png"><img src="../../../../../tools/tests/skdiff/baseDir/different-bits/very-different-sizes.png" height="240px"></a></td><td><a href="../../../../../tools/tests/skdiff/comparisonDir/different-bits/very-different-sizes.png"><img src="../../../../../tools/tests/skdiff/comparisonDir/different-bits/very-different-sizes.png" height="128px"></a></td></tr> <tr> <td><input type="checkbox" name="different-bits/very-different-pixels-same-size.png" checked="yes"></td><td><b>different-bits/very-different-pixels-same-size.png</b><br>97.9926% of pixels differ - (42.8911% weighted)<br>Average color mismatch 89<br>Max color mismatch 239</td><td><a href="different-bits_very-different-pixels-same-size-white.png"><img src="different-bits_very-different-pixels-same-size-white.png" height="240px"></a></td><td><a href="different-bits_very-different-pixels-same-size-diff.png"><img src="different-bits_very-different-pixels-same-size-diff.png" height="240px"></a></td><td><a href="../../../../../tools/tests/skdiff/baseDir/different-bits/very-different-pixels-same-size.png"><img src="../../../../../tools/tests/skdiff/baseDir/different-bits/very-different-pixels-same-size.png" height="240px"></a></td><td><a href="../../../../../tools/tests/skdiff/comparisonDir/different-bits/very-different-pixels-same-size.png"><img src="../../../../../tools/tests/skdiff/comparisonDir/different-bits/very-different-pixels-same-size.png" height="240px"></a></td></tr> + (42.8911% weighted)<br><br>Max alpha channel mismatch 0<br>Total alpha channel mismatch 0<br><br>Average color mismatch 89<br>Max color mismatch 239</td><td><a href="different-bits_very-different-pixels-same-size-white.png"><img src="different-bits_very-different-pixels-same-size-white.png" height="240px"></a></td><td><a href="different-bits_very-different-pixels-same-size-diff.png"><img src="different-bits_very-different-pixels-same-size-diff.png" height="240px"></a></td><td><a href="../../../../../tools/tests/skdiff/baseDir/different-bits/very-different-pixels-same-size.png"><img src="../../../../../tools/tests/skdiff/baseDir/different-bits/very-different-pixels-same-size.png" height="240px"></a></td><td><a href="../../../../../tools/tests/skdiff/comparisonDir/different-bits/very-different-pixels-same-size.png"><img src="../../../../../tools/tests/skdiff/comparisonDir/different-bits/very-different-pixels-same-size.png" height="240px"></a></td></tr> <tr> <td><input type="checkbox" name="different-bits/slightly-different-pixels-same-size.png" checked="yes"></td><td><b>different-bits/slightly-different-pixels-same-size.png</b><br>0.6630% of pixels differ - (0.1904% weighted)<br>(2164 pixels)<br>Average color mismatch 0<br>Max color mismatch 213</td><td><a href="different-bits_slightly-different-pixels-same-size-white.png"><img src="different-bits_slightly-different-pixels-same-size-white.png" height="240px"></a></td><td><a href="different-bits_slightly-different-pixels-same-size-diff.png"><img src="different-bits_slightly-different-pixels-same-size-diff.png" height="240px"></a></td><td><a href="../../../../../tools/tests/skdiff/baseDir/different-bits/slightly-different-pixels-same-size.png"><img src="../../../../../tools/tests/skdiff/baseDir/different-bits/slightly-different-pixels-same-size.png" height="240px"></a></td><td><a href="../../../../../tools/tests/skdiff/comparisonDir/different-bits/slightly-different-pixels-same-size.png"><img src="../../../../../tools/tests/skdiff/comparisonDir/different-bits/slightly-different-pixels-same-size.png" height="240px"></a></td></tr> + (0.1904% weighted)<br>(2164 pixels)<br><br>Max alpha channel mismatch 0<br>Total alpha channel mismatch 0<br><br>Average color mismatch 0<br>Max color mismatch 213</td><td><a href="different-bits_slightly-different-pixels-same-size-white.png"><img src="different-bits_slightly-different-pixels-same-size-white.png" height="240px"></a></td><td><a href="different-bits_slightly-different-pixels-same-size-diff.png"><img src="different-bits_slightly-different-pixels-same-size-diff.png" height="240px"></a></td><td><a href="../../../../../tools/tests/skdiff/baseDir/different-bits/slightly-different-pixels-same-size.png"><img src="../../../../../tools/tests/skdiff/baseDir/different-bits/slightly-different-pixels-same-size.png" height="240px"></a></td><td><a href="../../../../../tools/tests/skdiff/comparisonDir/different-bits/slightly-different-pixels-same-size.png"><img src="../../../../../tools/tests/skdiff/comparisonDir/different-bits/slightly-different-pixels-same-size.png" height="240px"></a></td></tr> </table> <input type="button" onclick="generateCheckedList()" value="Create Rebaseline List"> <div id="checkedList"></div> |