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 # | |
133 # Run skdiff tests... | |
epoger
2013/05/30 19:45:53
Patchset 2 rearranges some sections within run.sh
| |
134 # | |
135 | |
136 SKDIFF_TESTDIR=tools/tests/skdiff | |
137 | |
138 # Run skdiff over a variety of file pair types: identical bits, identical pixels , missing from | |
139 # baseDir, etc. | |
140 skdiff_test "$SKDIFF_TESTDIR/baseDir $SKDIFF_TESTDIR/comparisonDir" "$SKDIFF_TES TDIR/test1" | |
141 | |
142 # Run skdiff over the same set of files, but with arguments as used by our build bots: | |
143 # - return the number of mismatching file pairs (but ignore any files missing fr om either | |
144 # baseDir or comparisonDir) | |
145 # - list filenames with each result type to stdout | |
146 # - don't generate HTML output files | |
147 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" | |
148 | |
149 # Run skdiff over just the files that have identical bits. | |
150 skdiff_test "--nodiffs --match identical-bits $SKDIFF_TESTDIR/baseDir $SKDIFF_TE STDIR/comparisonDir" "$SKDIFF_TESTDIR/identical-bits" | |
151 | |
152 # Run skdiff over just the files that have identical bits or identical pixels. | |
153 skdiff_test "--nodiffs --match identical-bits --match identical-pixels $SKDIFF_T ESTDIR/baseDir $SKDIFF_TESTDIR/comparisonDir" "$SKDIFF_TESTDIR/identical-bits-or -pixels" | |
154 | |
155 # | |
156 # Run benchgraph tests... | |
157 # | |
158 | |
152 # Parse a collection of bench data leading up to | 159 # 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 | 160 # 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, | 161 # (this was during the period when the bench data included a ton of per-tile, |
155 # per-iteration data) | 162 # per-iteration data) |
156 PLATFORM=Skia_Shuttle_Ubuntu12_ATI5770_Float_Bench_32 | 163 PLATFORM=Skia_Shuttle_Ubuntu12_ATI5770_Float_Bench_32 |
157 benchgraph_download_rawdata $PLATFORM 7618 "$BENCHDATA_FILE_SUFFIXES_NO_INDIVIDU AL_TILES" | 164 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" | 165 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" | 166 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" | 167 benchgraph_download_rawdata $PLATFORM 7686 "$BENCHDATA_FILE_SUFFIXES_YES_INDIVID UAL_TILES" |
161 benchgraph_test $PLATFORM | 168 benchgraph_test $PLATFORM |
162 | 169 |
163 echo "All tests passed." | 170 echo "All tests passed." |
OLD | NEW |