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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 rm -rf $ACTUAL_OUTPUT_DIR | 61 rm -rf $ACTUAL_OUTPUT_DIR |
62 mkdir -p $ACTUAL_OUTPUT_DIR | 62 mkdir -p $ACTUAL_OUTPUT_DIR |
63 COMMAND="$SKDIFF_BINARY $SKDIFF_ARGS $ACTUAL_OUTPUT_DIR" | 63 COMMAND="$SKDIFF_BINARY $SKDIFF_ARGS $ACTUAL_OUTPUT_DIR" |
64 echo "$COMMAND" >$ACTUAL_OUTPUT_DIR/command_line | 64 echo "$COMMAND" >$ACTUAL_OUTPUT_DIR/command_line |
65 $COMMAND &>$ACTUAL_OUTPUT_DIR/stdout | 65 $COMMAND &>$ACTUAL_OUTPUT_DIR/stdout |
66 echo $? >$ACTUAL_OUTPUT_DIR/return_value | 66 echo $? >$ACTUAL_OUTPUT_DIR/return_value |
67 | 67 |
68 compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR | 68 compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR |
69 } | 69 } |
70 | 70 |
71 SKDIFF_TESTDIR=tools/tests/skdiff | |
72 | |
73 # Run skdiff over a variety of file pair types: identical bits, identical pixels
, missing from | |
74 # baseDir, etc. | |
75 skdiff_test "$SKDIFF_TESTDIR/baseDir $SKDIFF_TESTDIR/comparisonDir" "$SKDIFF_TES
TDIR/test1" | |
76 | |
77 # Run skdiff over the same set of files, but with arguments as used by our build
bots: | |
78 # - return the number of mismatching file pairs (but ignore any files missing fr
om either | |
79 # baseDir or comparisonDir) | |
80 # - list filenames with each result type to stdout | |
81 # - don't generate HTML output files | |
82 skdiff_test "--failonresult DifferentPixels --failonresult DifferentSizes --fail
onresult Unknown --failonstatus CouldNotDecode,CouldNotRead any --failonstatus a
ny CouldNotDecode,CouldNotRead --listfilenames --nodiffs $SKDIFF_TESTDIR/baseDir
$SKDIFF_TESTDIR/comparisonDir" "$SKDIFF_TESTDIR/test2" | |
83 | |
84 # Run skdiff over just the files that have identical bits. | |
85 skdiff_test "--nodiffs --match identical-bits $SKDIFF_TESTDIR/baseDir $SKDIFF_TE
STDIR/comparisonDir" "$SKDIFF_TESTDIR/identical-bits" | |
86 | |
87 # Run skdiff over just the files that have identical bits or identical pixels. | |
88 skdiff_test "--nodiffs --match identical-bits --match identical-pixels $SKDIFF_T
ESTDIR/baseDir $SKDIFF_TESTDIR/comparisonDir" "$SKDIFF_TESTDIR/identical-bits-or
-pixels" | |
89 | |
90 | |
91 # Download a subset of the raw bench data for platform $1 at revision $2. | 71 # Download a subset of the raw bench data for platform $1 at revision $2. |
92 # (For the subset, download all files matching any of the suffixes in | 72 # (For the subset, download all files matching any of the suffixes in |
93 # whitespace-separated list $3.) | 73 # whitespace-separated list $3.) |
94 # If any of those files already exist locally, we assume that they are | 74 # If any of those files already exist locally, we assume that they are |
95 # correct and up to date, and we don't download them again. | 75 # correct and up to date, and we don't download them again. |
96 function benchgraph_download_rawdata { | 76 function benchgraph_download_rawdata { |
97 if [ $# != 3 ]; then | 77 if [ $# != 3 ]; then |
98 echo "benchgraph_download_rawdata requires exactly 3 parameters, got $#" | 78 echo "benchgraph_download_rawdata requires exactly 3 parameters, got $#" |
99 exit 1 | 79 exit 1 |
100 fi | 80 fi |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 $COMMAND &>$ACTUAL_OUTPUT_DIR/stdout | 122 $COMMAND &>$ACTUAL_OUTPUT_DIR/stdout |
143 echo $? >$ACTUAL_OUTPUT_DIR/return_value | 123 echo $? >$ACTUAL_OUTPUT_DIR/return_value |
144 END_TIMESTAMP=$(date +%s) | 124 END_TIMESTAMP=$(date +%s) |
145 | 125 |
146 SECONDS_RUN=$(expr $END_TIMESTAMP - $START_TIMESTAMP) | 126 SECONDS_RUN=$(expr $END_TIMESTAMP - $START_TIMESTAMP) |
147 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" |
148 | 128 |
149 compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR | 129 compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR |
150 } | 130 } |
151 | 131 |
| 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. |
| 134 function rebaseline_test { |
| 135 if [ $# != 2 ]; then |
| 136 echo "rebaseline_test requires exactly 2 parameters, got $#" |
| 137 exit 1 |
| 138 fi |
| 139 ARGS="$1" |
| 140 ACTUAL_OUTPUT_DIR="$2/output-actual" |
| 141 EXPECTED_OUTPUT_DIR="$2/output-expected" |
| 142 |
| 143 rm -rf $ACTUAL_OUTPUT_DIR |
| 144 mkdir -p $ACTUAL_OUTPUT_DIR |
| 145 COMMAND="python tools/rebaseline.py --dry_run $ARGS" |
| 146 echo "$COMMAND" >$ACTUAL_OUTPUT_DIR/command_line |
| 147 $COMMAND &>$ACTUAL_OUTPUT_DIR/stdout |
| 148 echo $? >$ACTUAL_OUTPUT_DIR/return_value |
| 149 |
| 150 compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR |
| 151 } |
| 152 |
| 153 |
| 154 |
| 155 # |
| 156 # Run skdiff tests... |
| 157 # |
| 158 |
| 159 SKDIFF_TESTDIR=tools/tests/skdiff |
| 160 |
| 161 # Run skdiff over a variety of file pair types: identical bits, identical pixels
, missing from |
| 162 # baseDir, etc. |
| 163 skdiff_test "$SKDIFF_TESTDIR/baseDir $SKDIFF_TESTDIR/comparisonDir" "$SKDIFF_TES
TDIR/test1" |
| 164 |
| 165 # Run skdiff over the same set of files, but with arguments as used by our build
bots: |
| 166 # - return the number of mismatching file pairs (but ignore any files missing fr
om either |
| 167 # baseDir or comparisonDir) |
| 168 # - list filenames with each result type to stdout |
| 169 # - don't generate HTML output files |
| 170 skdiff_test "--failonresult DifferentPixels --failonresult DifferentSizes --fail
onresult Unknown --failonstatus CouldNotDecode,CouldNotRead any --failonstatus a
ny CouldNotDecode,CouldNotRead --listfilenames --nodiffs $SKDIFF_TESTDIR/baseDir
$SKDIFF_TESTDIR/comparisonDir" "$SKDIFF_TESTDIR/test2" |
| 171 |
| 172 # Run skdiff over just the files that have identical bits. |
| 173 skdiff_test "--nodiffs --match identical-bits $SKDIFF_TESTDIR/baseDir $SKDIFF_TE
STDIR/comparisonDir" "$SKDIFF_TESTDIR/identical-bits" |
| 174 |
| 175 # Run skdiff over just the files that have identical bits or identical pixels. |
| 176 skdiff_test "--nodiffs --match identical-bits --match identical-pixels $SKDIFF_T
ESTDIR/baseDir $SKDIFF_TESTDIR/comparisonDir" "$SKDIFF_TESTDIR/identical-bits-or
-pixels" |
| 177 |
| 178 # |
| 179 # Run benchgraph tests... |
| 180 # |
| 181 |
152 # Parse a collection of bench data leading up to | 182 # Parse a collection of bench data leading up to |
153 # http://70.32.156.53:10117/builders/Skia_Shuttle_Ubuntu12_ATI5770_Float_Bench_3
2/builds/878/steps/GenerateWebpagePictureBenchGraphs/logs/stdio | 183 # http://70.32.156.53:10117/builders/Skia_Shuttle_Ubuntu12_ATI5770_Float_Bench_3
2/builds/878/steps/GenerateWebpagePictureBenchGraphs/logs/stdio |
154 # (this was during the period when the bench data included a ton of per-tile, | 184 # (this was during the period when the bench data included a ton of per-tile, |
155 # per-iteration data) | 185 # per-iteration data) |
156 PLATFORM=Skia_Shuttle_Ubuntu12_ATI5770_Float_Bench_32 | 186 PLATFORM=Skia_Shuttle_Ubuntu12_ATI5770_Float_Bench_32 |
157 benchgraph_download_rawdata $PLATFORM 7618 "$BENCHDATA_FILE_SUFFIXES_NO_INDIVIDU
AL_TILES" | 187 benchgraph_download_rawdata $PLATFORM 7618 "$BENCHDATA_FILE_SUFFIXES_NO_INDIVIDU
AL_TILES" |
158 benchgraph_download_rawdata $PLATFORM 7671 "$BENCHDATA_FILE_SUFFIXES_YES_INDIVID
UAL_TILES" | 188 benchgraph_download_rawdata $PLATFORM 7671 "$BENCHDATA_FILE_SUFFIXES_YES_INDIVID
UAL_TILES" |
159 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" |
160 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" |
161 benchgraph_test $PLATFORM | 191 benchgraph_test $PLATFORM |
162 | 192 |
| 193 # |
| 194 # Test rebaseline.py ... |
| 195 # |
| 196 |
| 197 REBASELINE_TESTDIR=tools/tests/rebaseline |
| 198 rebaseline_test "--tests test1 test2 --configs 565 8888 --subdirs base-android-g
alaxy-nexus base-shuttle-win7-intel-float" "$REBASELINE_TESTDIR/subset" |
| 199 rebaseline_test "--tests test1 test2" "$REBASELINE_TESTDIR/all" |
| 200 |
| 201 |
163 echo "All tests passed." | 202 echo "All tests passed." |
OLD | NEW |