OLD | NEW |
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 # Confirm that IntentionallySkipped tests are recorded as such. | 210 # Confirm that IntentionallySkipped tests are recorded as such. |
211 gm_test "--verbose --hierarchy --match selftest1 selftest2 $CONFIGS" "$GM_OUTPUT
S/intentionally-skipped-tests" | 211 gm_test "--verbose --hierarchy --match selftest1 selftest2 $CONFIGS" "$GM_OUTPUT
S/intentionally-skipped-tests" |
212 | 212 |
213 # Ignore some error types (including ExpectationsMismatch) | 213 # Ignore some error types (including ExpectationsMismatch) |
214 gm_test "--ignoreErrorTypes ExpectationsMismatch NoGpuContext --verbose --hierar
chy --match selftest1 $CONFIGS -r $GM_INPUTS/json/different-pixels.json" "$GM_OU
TPUTS/ignore-expectations-mismatch" | 214 gm_test "--ignoreErrorTypes ExpectationsMismatch NoGpuContext --verbose --hierar
chy --match selftest1 $CONFIGS -r $GM_INPUTS/json/different-pixels.json" "$GM_OU
TPUTS/ignore-expectations-mismatch" |
215 | 215 |
216 # Test non-hierarchical mode. | 216 # Test non-hierarchical mode. |
217 gm_test "--verbose --match selftest1 $CONFIGS -r $GM_INPUTS/json/different-pixel
s-no-hierarchy.json" "$GM_OUTPUTS/no-hierarchy" | 217 gm_test "--verbose --match selftest1 $CONFIGS -r $GM_INPUTS/json/different-pixel
s-no-hierarchy.json" "$GM_OUTPUTS/no-hierarchy" |
218 | 218 |
| 219 # Try writing out actual images using checksum-based filenames, like we do when |
| 220 # uploading to Google Storage. |
| 221 gm_test "--verbose --writeChecksumBasedFilenames --match selftest1 $CONFIGS -r $
GM_INPUTS/json/different-pixels-no-hierarchy.json" "$GM_OUTPUTS/checksum-based-f
ilenames" |
| 222 |
219 # Exercise display_json_results.py | 223 # Exercise display_json_results.py |
220 PASSING_CASES="compared-against-identical-bytes-json compared-against-identical-
pixels-json" | 224 PASSING_CASES="compared-against-identical-bytes-json compared-against-identical-
pixels-json" |
221 FAILING_CASES="compared-against-different-pixels-json" | 225 FAILING_CASES="compared-against-different-pixels-json" |
222 for CASE in $PASSING_CASES; do | 226 for CASE in $PASSING_CASES; do |
223 assert_passes "python gm/display_json_results.py $GM_OUTPUTS/$CASE/$OUTPUT_EXP
ECTED_SUBDIR/json-summary.txt" | 227 assert_passes "python gm/display_json_results.py $GM_OUTPUTS/$CASE/$OUTPUT_EXP
ECTED_SUBDIR/json-summary.txt" |
224 done | 228 done |
225 for CASE in $FAILING_CASES; do | 229 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" | 230 assert_fails "python gm/display_json_results.py $GM_OUTPUTS/$CASE/$OUTPUT_EXPE
CTED_SUBDIR/json-summary.txt" |
227 done | 231 done |
228 | 232 |
229 if [ $ENCOUNTERED_ANY_ERRORS == 0 ]; then | 233 if [ $ENCOUNTERED_ANY_ERRORS == 0 ]; then |
230 echo "All tests passed." | 234 echo "All tests passed." |
231 exit 0 | 235 exit 0 |
232 else | 236 else |
233 exit 1 | 237 exit 1 |
234 fi | 238 fi |
OLD | NEW |