Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: gm/tests/run.sh

Issue 17366003: GM: stop recording all *_pdf.png results as "INVALID" on non-Mac platforms (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: fix Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Self-tests for gm, based on tools/tests/run.sh 3 # Self-tests for gm, based on tools/tests/run.sh
4 # 4 #
5 # These tests are run by the Skia_PerCommit_House_Keeping bot at every commit, 5 # These tests are run by the Skia_PerCommit_House_Keeping bot at every commit,
6 # so make sure that they still pass when you make changes to gm! 6 # so make sure that they still pass when you make changes to gm!
7 # 7 #
8 # To generate new baselines when gm behavior changes, run gm/tests/rebaseline.sh 8 # To generate new baselines when gm behavior changes, run gm/tests/rebaseline.sh
9 # 9 #
10 # TODO: because this is written as a shell script (instead of, say, Python) 10 # TODO: because this is written as a shell script (instead of, say, Python)
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 grep ^GM: $ACTUAL_OUTPUT_DIR/stderr >$ACTUAL_OUTPUT_DIR/stderr-tmp 101 grep ^GM: $ACTUAL_OUTPUT_DIR/stderr >$ACTUAL_OUTPUT_DIR/stderr-tmp
102 mv $ACTUAL_OUTPUT_DIR/stderr-tmp $ACTUAL_OUTPUT_DIR/stderr 102 mv $ACTUAL_OUTPUT_DIR/stderr-tmp $ACTUAL_OUTPUT_DIR/stderr
103 103
104 # Replace image file contents with just the filename, for two reasons: 104 # Replace image file contents with just the filename, for two reasons:
105 # 1. Image file encoding may vary by platform 105 # 1. Image file encoding may vary by platform
106 # 2. https://code.google.com/p/chromium/issues/detail?id=169600 106 # 2. https://code.google.com/p/chromium/issues/detail?id=169600
107 # ('gcl/upload.py fail to upload binary files to rietveld') 107 # ('gcl/upload.py fail to upload binary files to rietveld')
108 for IMAGEFILE in $(find $ACTUAL_OUTPUT_DIR -name *.png); do 108 for IMAGEFILE in $(find $ACTUAL_OUTPUT_DIR -name *.png); do
109 echo "[contents of $IMAGEFILE]" >$IMAGEFILE 109 echo "[contents of $IMAGEFILE]" >$IMAGEFILE
110 done 110 done
111 for IMAGEFILE in $(find $ACTUAL_OUTPUT_DIR -name *.pdf); do
112 echo "[contents of $IMAGEFILE]" >$IMAGEFILE
113 done
edisonn 2013/06/21 14:04:26 Just a general comment: The thing that I am worrie
111 if [ -d $ACTUAL_OUTPUT_DIR/mismatchPath ]; then 114 if [ -d $ACTUAL_OUTPUT_DIR/mismatchPath ]; then
112 for MISMATCHDIR in $(find $ACTUAL_OUTPUT_DIR/mismatchPath -mindepth 1 -type d); do 115 for MISMATCHDIR in $(find $ACTUAL_OUTPUT_DIR/mismatchPath -mindepth 1 -type d); do
113 echo "Created additional file to make sure directory isn't empty, because self-test cannot handle empty directories." >$MISMATCHDIR/bogusfile 116 echo "Created additional file to make sure directory isn't empty, because self-test cannot handle empty directories." >$MISMATCHDIR/bogusfile
114 done 117 done
115 fi 118 fi
116 119
117 compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR 120 compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR
118 } 121 }
119 122
120 # Create input dir (at path $1) with expectations (both image and json) 123 # Create input dir (at path $1) with expectations (both image and json)
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 195
193 # Compare generated image against an empty "expected image" dir. 196 # Compare generated image against an empty "expected image" dir.
194 gm_test "--verbose --hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/e mpty-dir" "$GM_OUTPUTS/compared-against-empty-dir" 197 gm_test "--verbose --hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/e mpty-dir" "$GM_OUTPUTS/compared-against-empty-dir"
195 198
196 # Compare generated image against a nonexistent "expected image" dir. 199 # Compare generated image against a nonexistent "expected image" dir.
197 gm_test "--verbose --hierarchy --match selftest1 $CONFIGS -r ../path/to/nowhere" "$GM_OUTPUTS/compared-against-nonexistent-dir" 200 gm_test "--verbose --hierarchy --match selftest1 $CONFIGS -r ../path/to/nowhere" "$GM_OUTPUTS/compared-against-nonexistent-dir"
198 201
199 # Compare generated image against an empty "expected image" dir, but NOT in verb ose mode. 202 # Compare generated image against an empty "expected image" dir, but NOT in verb ose mode.
200 gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/empty-dir" "$GM_OUTPUTS/nonverbose" 203 gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/empty-dir" "$GM_OUTPUTS/nonverbose"
201 204
205 # Add pdf to the list of configs.
206 gm_test "--verbose --hierarchy --match selftest1 $CONFIGS pdf -r $GM_INPUTS/json /identical-bytes.json" "$GM_OUTPUTS/add-config-pdf"
207
202 # If run without "-r", the JSON's "actual-results" section should contain 208 # If run without "-r", the JSON's "actual-results" section should contain
203 # actual checksums marked as "failure-ignored", but the "expected-results" 209 # actual checksums marked as "failure-ignored", but the "expected-results"
204 # section should be empty. 210 # section should be empty.
205 gm_test "--verbose --hierarchy --match selftest1 $CONFIGS" "$GM_OUTPUTS/no-readp ath" 211 gm_test "--verbose --hierarchy --match selftest1 $CONFIGS" "$GM_OUTPUTS/no-readp ath"
206 212
207 # Test what happens if a subset of the renderModes fail (e.g. pipe) 213 # Test what happens if a subset of the renderModes fail (e.g. pipe)
208 gm_test "--simulatePipePlaybackFailure --verbose --hierarchy --match selftest1 $ CONFIGS -r $GM_INPUTS/json/identical-pixels.json" "$GM_OUTPUTS/pipe-playback-fai lure" 214 gm_test "--simulatePipePlaybackFailure --verbose --hierarchy --match selftest1 $ CONFIGS -r $GM_INPUTS/json/identical-pixels.json" "$GM_OUTPUTS/pipe-playback-fai lure"
209 215
210 # Confirm that IntentionallySkipped tests are recorded as such. 216 # Confirm that IntentionallySkipped tests are recorded as such.
211 gm_test "--verbose --hierarchy --match selftest1 selftest2 $CONFIGS" "$GM_OUTPUT S/intentionally-skipped-tests" 217 gm_test "--verbose --hierarchy --match selftest1 selftest2 $CONFIGS" "$GM_OUTPUT S/intentionally-skipped-tests"
(...skipping 13 matching lines...) Expand all
225 for CASE in $FAILING_CASES; do 231 for CASE in $FAILING_CASES; do
226 assert_fails "python gm/display_json_results.py $GM_OUTPUTS/$CASE/$OUTPUT_EXPE CTED_SUBDIR/json-summary.txt" 232 assert_fails "python gm/display_json_results.py $GM_OUTPUTS/$CASE/$OUTPUT_EXPE CTED_SUBDIR/json-summary.txt"
227 done 233 done
228 234
229 if [ $ENCOUNTERED_ANY_ERRORS == 0 ]; then 235 if [ $ENCOUNTERED_ANY_ERRORS == 0 ]; then
230 echo "All tests passed." 236 echo "All tests passed."
231 exit 0 237 exit 0
232 else 238 else
233 exit 1 239 exit 1
234 fi 240 fi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698