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

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

Issue 12381038: gm self-test: use a pathologically simple test case instead of dashing2 (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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 # TODO: currently, this only passes on Linux (which is the platform that 8 # TODO: currently, this only passes on Linux (which is the platform that
9 # the housekeeper bot runs on, e.g. 9 # the housekeeper bot runs on, e.g.
10 # http://70.32.156.51:10117/builders/Skia_PerCommit_House_Keeping/builds/1417/st eps/RunGmSelfTests/logs/stdio ) 10 # http://70.32.156.51:10117/builders/Skia_PerCommit_House_Keeping/builds/1417/st eps/RunGmSelfTests/logs/stdio )
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 # Only compare selected lines in the stdout, to ignore any spurious lines 67 # Only compare selected lines in the stdout, to ignore any spurious lines
68 # as noted in http://code.google.com/p/skia/issues/detail?id=1068 . 68 # as noted in http://code.google.com/p/skia/issues/detail?id=1068 .
69 # 69 #
70 # TODO(epoger): This is still hacky... we need to rewrite this script in 70 # TODO(epoger): This is still hacky... we need to rewrite this script in
71 # Python soon, and make stuff like this more maintainable. 71 # Python soon, and make stuff like this more maintainable.
72 grep --regexp=^reading --regexp=^writing --regexp=^drawing \ 72 grep --regexp=^reading --regexp=^writing --regexp=^drawing \
73 --regexp=^FAILED --regexp=^Ran $ACTUAL_OUTPUT_DIR/stdout \ 73 --regexp=^FAILED --regexp=^Ran $ACTUAL_OUTPUT_DIR/stdout \
74 >$ACTUAL_OUTPUT_DIR/stdout-tmp 74 >$ACTUAL_OUTPUT_DIR/stdout-tmp
75 mv $ACTUAL_OUTPUT_DIR/stdout-tmp $ACTUAL_OUTPUT_DIR/stdout 75 mv $ACTUAL_OUTPUT_DIR/stdout-tmp $ACTUAL_OUTPUT_DIR/stdout
76 76
77 # Replace particular checksums in json summary with a placeholder, so
78 # we don't need to rebaseline these json files when our drawing routines
79 # change.
80 sed -e 's/"checksum" : [0-9]*/"checksum" : FAKE/g' \
81 --in-place $JSON_SUMMARY_FILE
82 sed -e 's/"checksums" : \[ [0-9]* \]/"checksums" : [ FAKE ]/g' \
83 --in-place $JSON_SUMMARY_FILE
84
85 compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR 77 compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR
86 } 78 }
87 79
88 # Create input dir (at path $1) with expectations (both image and json) 80 # Create input dir (at path $1) with expectations (both image and json)
89 # that gm will match or mismatch as appropriate. 81 # that gm will match or mismatch as appropriate.
90 # 82 #
91 # We used to check these files into SVN, but then we needed to rebasline them 83 # We used to check these files into SVN, but then we needed to rebasline them
92 # when our drawing changed at all... so, as proposed in 84 # when our drawing changed at all... so, as proposed in
93 # http://code.google.com/p/skia/issues/detail?id=1068 , we generate them 85 # http://code.google.com/p/skia/issues/detail?id=1068 , we generate them
94 # new each time. 86 # new each time.
95 function create_inputs_dir { 87 function create_inputs_dir {
96 if [ $# != 1 ]; then 88 if [ $# != 1 ]; then
97 echo "create_inputs_dir requires exactly 1 parameter, got $#" 89 echo "create_inputs_dir requires exactly 1 parameter, got $#"
98 exit 1 90 exit 1
99 fi 91 fi
100 INPUTS_DIR="$1" 92 INPUTS_DIR="$1"
101 IMAGES_DIR=$INPUTS_DIR/images 93 IMAGES_DIR=$INPUTS_DIR/images
102 JSON_DIR=$INPUTS_DIR/json 94 JSON_DIR=$INPUTS_DIR/json
103 mkdir -p $IMAGES_DIR $JSON_DIR 95 mkdir -p $IMAGES_DIR $JSON_DIR
104 96
105 mkdir -p $IMAGES_DIR/identical-bytes 97 mkdir -p $IMAGES_DIR/identical-bytes
106 # Run GM to write out the images actually generated. 98 # Run GM to write out the images actually generated.
107 $GM_BINARY --hierarchy --match dashing2 $CONFIGS \ 99 $GM_BINARY --hierarchy --match selftest1 $CONFIGS \
108 -w $IMAGES_DIR/identical-bytes 100 -w $IMAGES_DIR/identical-bytes
109 # Run GM again to read in those images and write them out as a JSON summary. 101 # Run GM again to read in those images and write them out as a JSON summary.
110 $GM_BINARY --hierarchy --match dashing2 $CONFIGS \ 102 $GM_BINARY --hierarchy --match selftest1 $CONFIGS \
111 -r $IMAGES_DIR/identical-bytes \ 103 -r $IMAGES_DIR/identical-bytes \
112 --writeJsonSummary $JSON_DIR/identical-bytes.json 104 --writeJsonSummary $JSON_DIR/identical-bytes.json
113 105
114 mkdir -p $IMAGES_DIR/identical-pixels 106 mkdir -p $IMAGES_DIR/identical-pixels
115 $GM_BINARY --hierarchy --match dashing2 $CONFIGS \ 107 $GM_BINARY --hierarchy --match selftest1 $CONFIGS \
116 -w $IMAGES_DIR/identical-pixels 108 -w $IMAGES_DIR/identical-pixels
117 echo "more bytes that do not change the image pixels" \ 109 echo "more bytes that do not change the image pixels" \
118 >> $IMAGES_DIR/identical-pixels/8888/dashing2.png 110 >> $IMAGES_DIR/identical-pixels/8888/selftest1.png
119 echo "more bytes that do not change the image pixels" \ 111 echo "more bytes that do not change the image pixels" \
120 >> $IMAGES_DIR/identical-pixels/565/dashing2.png 112 >> $IMAGES_DIR/identical-pixels/565/selftest1.png
121 $GM_BINARY --hierarchy --match dashing2 $CONFIGS \ 113 $GM_BINARY --hierarchy --match selftest1 $CONFIGS \
122 -r $IMAGES_DIR/identical-pixels \ 114 -r $IMAGES_DIR/identical-pixels \
123 --writeJsonSummary $JSON_DIR/identical-pixels.json 115 --writeJsonSummary $JSON_DIR/identical-pixels.json
124 116
125 mkdir -p $IMAGES_DIR/different-pixels 117 mkdir -p $IMAGES_DIR/different-pixels
126 $GM_BINARY --hierarchy --match dashing3 $CONFIGS \ 118 $GM_BINARY --hierarchy --match selftest2 $CONFIGS \
127 -w $IMAGES_DIR/different-pixels 119 -w $IMAGES_DIR/different-pixels
128 mv $IMAGES_DIR/different-pixels/8888/dashing3.png \ 120 mv $IMAGES_DIR/different-pixels/8888/selftest2.png \
129 $IMAGES_DIR/different-pixels/8888/dashing2.png 121 $IMAGES_DIR/different-pixels/8888/selftest1.png
130 mv $IMAGES_DIR/different-pixels/565/dashing3.png \ 122 mv $IMAGES_DIR/different-pixels/565/selftest2.png \
131 $IMAGES_DIR/different-pixels/565/dashing2.png 123 $IMAGES_DIR/different-pixels/565/selftest1.png
132 $GM_BINARY --hierarchy --match dashing2 $CONFIGS \ 124 $GM_BINARY --hierarchy --match selftest1 $CONFIGS \
133 -r $IMAGES_DIR/different-pixels \ 125 -r $IMAGES_DIR/different-pixels \
134 --writeJsonSummary $JSON_DIR/different-pixels.json 126 --writeJsonSummary $JSON_DIR/different-pixels.json
135 127
136 mkdir -p $IMAGES_DIR/empty-dir 128 mkdir -p $IMAGES_DIR/empty-dir
137 } 129 }
138 130
139 GM_TESTDIR=gm/tests 131 GM_TESTDIR=gm/tests
140 GM_INPUTS=$GM_TESTDIR/inputs 132 GM_INPUTS=$GM_TESTDIR/inputs
141 GM_OUTPUTS=$GM_TESTDIR/outputs 133 GM_OUTPUTS=$GM_TESTDIR/outputs
142 GM_TEMPFILES=$GM_TESTDIR/tempfiles 134 GM_TEMPFILES=$GM_TESTDIR/tempfiles
143 135
144 create_inputs_dir $GM_INPUTS 136 create_inputs_dir $GM_INPUTS
145 137
146 # Compare generated image against an input image file with identical bytes. 138 # Compare generated image against an input image file with identical bytes.
147 gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/images/identical-by tes" "$GM_OUTPUTS/compared-against-identical-bytes-images" 139 gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/identical-b ytes" "$GM_OUTPUTS/compared-against-identical-bytes-images"
148 gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/json/identical-byte s.json" "$GM_OUTPUTS/compared-against-identical-bytes-json" 140 gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/json/identical-byt es.json" "$GM_OUTPUTS/compared-against-identical-bytes-json"
149 141
150 # Compare generated image against an input image file with identical pixels but different PNG encoding. 142 # Compare generated image against an input image file with identical pixels but different PNG encoding.
151 gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/images/identical-pi xels" "$GM_OUTPUTS/compared-against-identical-pixels-images" 143 gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/identical-p ixels" "$GM_OUTPUTS/compared-against-identical-pixels-images"
152 gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/json/identical-pixe ls.json" "$GM_OUTPUTS/compared-against-identical-pixels-json" 144 gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/json/identical-pix els.json" "$GM_OUTPUTS/compared-against-identical-pixels-json"
153 145
154 # Compare generated image against an input image file with different pixels. 146 # Compare generated image against an input image file with different pixels.
155 gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/images/different-pi xels" "$GM_OUTPUTS/compared-against-different-pixels-images" 147 gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/different-p ixels" "$GM_OUTPUTS/compared-against-different-pixels-images"
156 gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/json/different-pixe ls.json" "$GM_OUTPUTS/compared-against-different-pixels-json" 148 gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/json/different-pix els.json" "$GM_OUTPUTS/compared-against-different-pixels-json"
157 149
158 # Compare generated image against an empty "expected image" dir. 150 # Compare generated image against an empty "expected image" dir.
159 gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/images/empty-dir" " $GM_OUTPUTS/compared-against-empty-dir" 151 gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/empty-dir" "$GM_OUTPUTS/compared-against-empty-dir"
160 152
161 # If run without "-r", the JSON's "actual-results" section should contain 153 # If run without "-r", the JSON's "actual-results" section should contain
162 # actual checksums marked as "failure-ignored", but the "expected-results" 154 # actual checksums marked as "failure-ignored", but the "expected-results"
163 # section should be empty. 155 # section should be empty.
164 gm_test "--hierarchy --match dashing2 $CONFIGS" "$GM_OUTPUTS/no-readpath" 156 gm_test "--hierarchy --match selftest1 $CONFIGS" "$GM_OUTPUTS/no-readpath"
165 157
166 # Run a test which generates partially transparent images, write out those 158 # Run a test which generates partially transparent images, write out those
167 # images, and read them back in. 159 # images, and read them back in.
168 # 160 #
169 # This test would have caught 161 # This test would have caught
170 # http://code.google.com/p/skia/issues/detail?id=1079 ('gm generating 162 # http://code.google.com/p/skia/issues/detail?id=1079 ('gm generating
171 # spurious pixel_error messages as of r7258'). 163 # spurious pixel_error messages as of r7258').
172 IMAGEDIR=$GM_TEMPFILES/aaclip-images 164 IMAGEDIR=$GM_TEMPFILES/aaclip-images
173 rm -rf $IMAGEDIR 165 rm -rf $IMAGEDIR
174 mkdir -p $IMAGEDIR 166 mkdir -p $IMAGEDIR
175 gm_test "--match simpleaaclip_path $CONFIGS -w $IMAGEDIR" "$GM_OUTPUTS/aaclip-wr ite" 167 gm_test "--match simpleaaclip_path $CONFIGS -w $IMAGEDIR" "$GM_OUTPUTS/aaclip-wr ite"
176 gm_test "--match simpleaaclip_path $CONFIGS -r $IMAGEDIR" "$GM_OUTPUTS/aaclip-re adback" 168 gm_test "--match simpleaaclip_path $CONFIGS -r $IMAGEDIR" "$GM_OUTPUTS/aaclip-re adback"
177 169
178 echo "All tests passed." 170 echo "All tests passed."
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698