OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Tests for our tools. | 3 # Tests for our tools. |
4 # | 4 # |
5 # TODO: currently, this only passes on Linux (which is the platform that | 5 # TODO: currently, this only passes on Linux (which is the platform that |
6 # the housekeeper bot runs on, e.g. | 6 # the housekeeper bot runs on, e.g. |
7 # http://70.32.156.51:10117/builders/Skia_PerCommit_House_Keeping/builds/1415/st
eps/RunToolSelfTests/logs/stdio ) | 7 # http://70.32.156.51:10117/builders/Skia_PerCommit_House_Keeping/builds/1415/st
eps/RunToolSelfTests/logs/stdio ) |
8 # See https://code.google.com/p/skia/issues/detail?id=677 | 8 # See https://code.google.com/p/skia/issues/detail?id=677 |
9 # ('make tools/tests/run.sh work cross-platform') | 9 # ('make tools/tests/run.sh work cross-platform') |
10 # Ideally, these tests should pass on all development platforms... | 10 # Ideally, these tests should pass on all development platforms... |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 $COMMAND &>$ACTUAL_OUTPUT_DIR/stdout | 122 $COMMAND &>$ACTUAL_OUTPUT_DIR/stdout |
123 echo $? >$ACTUAL_OUTPUT_DIR/return_value | 123 echo $? >$ACTUAL_OUTPUT_DIR/return_value |
124 END_TIMESTAMP=$(date +%s) | 124 END_TIMESTAMP=$(date +%s) |
125 | 125 |
126 SECONDS_RUN=$(expr $END_TIMESTAMP - $START_TIMESTAMP) | 126 SECONDS_RUN=$(expr $END_TIMESTAMP - $START_TIMESTAMP) |
127 echo "bench_graph_svg.py for $PLATFORM took $SECONDS_RUN seconds to complete" | 127 echo "bench_graph_svg.py for $PLATFORM took $SECONDS_RUN seconds to complete" |
128 | 128 |
129 compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR | 129 compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR |
130 } | 130 } |
131 | 131 |
132 # Run rebaseline.py with arguments in $1, recording its dry_run output. | 132 # Run rebaseline.py with arguments in $1, recording its dry-run output. |
133 # Then compare that dry_run output to the content of $2/output-expected. | 133 # Then compare that dry-run output to the content of $2/output-expected. |
134 function rebaseline_test { | 134 function rebaseline_test { |
135 if [ $# != 2 ]; then | 135 if [ $# != 2 ]; then |
136 echo "rebaseline_test requires exactly 2 parameters, got $#" | 136 echo "rebaseline_test requires exactly 2 parameters, got $#" |
137 exit 1 | 137 exit 1 |
138 fi | 138 fi |
139 ARGS="$1" | 139 ARGS="$1" |
140 ACTUAL_OUTPUT_DIR="$2/output-actual" | 140 ACTUAL_OUTPUT_DIR="$2/output-actual" |
141 EXPECTED_OUTPUT_DIR="$2/output-expected" | 141 EXPECTED_OUTPUT_DIR="$2/output-expected" |
142 | 142 |
143 rm -rf $ACTUAL_OUTPUT_DIR | 143 rm -rf $ACTUAL_OUTPUT_DIR |
144 mkdir -p $ACTUAL_OUTPUT_DIR | 144 mkdir -p $ACTUAL_OUTPUT_DIR |
145 COMMAND="python tools/rebaseline.py --dry_run $ARGS" | 145 COMMAND="python tools/rebaseline.py --dry-run $ARGS" |
146 echo "$COMMAND" >$ACTUAL_OUTPUT_DIR/command_line | 146 echo "$COMMAND" >$ACTUAL_OUTPUT_DIR/command_line |
147 $COMMAND &>$ACTUAL_OUTPUT_DIR/stdout | 147 $COMMAND &>$ACTUAL_OUTPUT_DIR/stdout |
148 echo $? >$ACTUAL_OUTPUT_DIR/return_value | 148 echo $? >$ACTUAL_OUTPUT_DIR/return_value |
149 | 149 |
150 compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR | 150 compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR |
151 } | 151 } |
152 | 152 |
153 | 153 |
154 | 154 |
155 # | 155 # |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 benchgraph_download_rawdata $PLATFORM 7679 "$BENCHDATA_FILE_SUFFIXES_YES_INDIVID
UAL_TILES" | 189 benchgraph_download_rawdata $PLATFORM 7679 "$BENCHDATA_FILE_SUFFIXES_YES_INDIVID
UAL_TILES" |
190 benchgraph_download_rawdata $PLATFORM 7686 "$BENCHDATA_FILE_SUFFIXES_YES_INDIVID
UAL_TILES" | 190 benchgraph_download_rawdata $PLATFORM 7686 "$BENCHDATA_FILE_SUFFIXES_YES_INDIVID
UAL_TILES" |
191 benchgraph_test $PLATFORM | 191 benchgraph_test $PLATFORM |
192 | 192 |
193 # | 193 # |
194 # Test rebaseline.py ... | 194 # Test rebaseline.py ... |
195 # | 195 # |
196 | 196 |
197 REBASELINE_INPUT=tools/tests/rebaseline/input | 197 REBASELINE_INPUT=tools/tests/rebaseline/input |
198 REBASELINE_OUTPUT=tools/tests/rebaseline/output | 198 REBASELINE_OUTPUT=tools/tests/rebaseline/output |
199 rebaseline_test "--tests test1 test2 --configs 565 8888 --subdirs base-android-g
alaxy-nexus base-shuttle-win7-intel-float" "$REBASELINE_OUTPUT/subset" | 199 BASELINE_OPTIONS="--json-base-url file:$REBASELINE_INPUT/json1 --subdirs base-an
droid-galaxy-nexus base-macmini base-shuttle-win7-intel-float" |
200 rebaseline_test "--tests test1 test2" "$REBASELINE_OUTPUT/all" | 200 rebaseline_test "$BASELINE_OPTIONS" "$REBASELINE_OUTPUT/all" |
201 rebaseline_test "--json_base_url file:$REBASELINE_INPUT/json1 --subdirs base-and
roid-galaxy-nexus base-shuttle-win7-intel-float" "$REBASELINE_OUTPUT/using-json1
" | 201 rebaseline_test "$BASELINE_OPTIONS --configs 8888 pdf" "$REBASELINE_OUTPUT/confi
gs" |
| 202 rebaseline_test "$BASELINE_OPTIONS --tests aa imageblur" "$REBASELINE_OUTPUT/tes
ts" |
| 203 rebaseline_test "$BASELINE_OPTIONS --tests aaclip --add-new" "$REBASELINE_OUTPUT
/add-new-tests" |
202 | 204 |
203 | 205 |
204 echo "All tests passed." | 206 echo "All tests passed." |
OLD | NEW |