Chromium Code Reviews| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 | 192 |
| 193 # Compare generated image against an empty "expected image" dir. | 193 # 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" | 194 gm_test "--verbose --hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/e mpty-dir" "$GM_OUTPUTS/compared-against-empty-dir" |
| 195 | 195 |
| 196 # Compare generated image against a nonexistent "expected image" dir. | 196 # 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" | 197 gm_test "--verbose --hierarchy --match selftest1 $CONFIGS -r ../path/to/nowhere" "$GM_OUTPUTS/compared-against-nonexistent-dir" |
| 198 | 198 |
| 199 # Compare generated image against an empty "expected image" dir, but NOT in verb ose mode. | 199 # 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" | 200 gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/empty-dir" "$GM_OUTPUTS/nonverbose" |
| 201 | 201 |
| 202 # Add pdf to the list of configs. | |
| 203 gm_test "--verbose --hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/json/ide ntical-bytes.json" "$GM_OUTPUTS/add-config-pdf" | |
|
epoger
2013/06/18 04:22:35
Patchset 1 adds a new "add-config-pdf" self-test,
| |
| 204 | |
| 202 # If run without "-r", the JSON's "actual-results" section should contain | 205 # If run without "-r", the JSON's "actual-results" section should contain |
| 203 # actual checksums marked as "failure-ignored", but the "expected-results" | 206 # actual checksums marked as "failure-ignored", but the "expected-results" |
| 204 # section should be empty. | 207 # section should be empty. |
| 205 gm_test "--verbose --hierarchy --match selftest1 $CONFIGS" "$GM_OUTPUTS/no-readp ath" | 208 gm_test "--verbose --hierarchy --match selftest1 $CONFIGS" "$GM_OUTPUTS/no-readp ath" |
| 206 | 209 |
| 207 # Test what happens if a subset of the renderModes fail (e.g. pipe) | 210 # 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" | 211 gm_test "--simulatePipePlaybackFailure --verbose --hierarchy --match selftest1 $ CONFIGS -r $GM_INPUTS/json/identical-pixels.json" "$GM_OUTPUTS/pipe-playback-fai lure" |
| 209 | 212 |
| 210 # Confirm that IntentionallySkipped tests are recorded as such. | 213 # Confirm that IntentionallySkipped tests are recorded as such. |
| 211 gm_test "--verbose --hierarchy --match selftest1 selftest2 $CONFIGS" "$GM_OUTPUT S/intentionally-skipped-tests" | 214 gm_test "--verbose --hierarchy --match selftest1 selftest2 $CONFIGS" "$GM_OUTPUT S/intentionally-skipped-tests" |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 225 for CASE in $FAILING_CASES; do | 228 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" | 229 assert_fails "python gm/display_json_results.py $GM_OUTPUTS/$CASE/$OUTPUT_EXPE CTED_SUBDIR/json-summary.txt" |
| 227 done | 230 done |
| 228 | 231 |
| 229 if [ $ENCOUNTERED_ANY_ERRORS == 0 ]; then | 232 if [ $ENCOUNTERED_ANY_ERRORS == 0 ]; then |
| 230 echo "All tests passed." | 233 echo "All tests passed." |
| 231 exit 0 | 234 exit 0 |
| 232 else | 235 else |
| 233 exit 1 | 236 exit 1 |
| 234 fi | 237 fi |
| OLD | NEW |