OLD | NEW |
1 ''' | 1 ''' |
2 Created on May 16, 2011 | 2 Created on May 16, 2011 |
3 | 3 |
4 @author: bungeman | 4 @author: bungeman |
5 ''' | 5 ''' |
6 import bench_util | 6 import bench_util |
7 import getopt | 7 import getopt |
8 import httplib | 8 import httplib |
9 import itertools | 9 import itertools |
10 import json | 10 import json |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 ratios.sort(reverse=True) | 168 ratios.sort(reverse=True) |
169 li = [] | 169 li = [] |
170 for ratio in ratios: | 170 for ratio in ratios: |
171 li.extend(exceptions[i][ratio]) | 171 li.extend(exceptions[i][ratio]) |
172 header = '%s benches got slower (sorted by %% difference):' % len(li) | 172 header = '%s benches got slower (sorted by %% difference):' % len(li) |
173 if i == FASTER: | 173 if i == FASTER: |
174 header = header.replace('slower', 'faster') | 174 header = header.replace('slower', 'faster') |
175 outputs.extend(['', header] + li) | 175 outputs.extend(['', header] + li) |
176 | 176 |
177 if outputs: | 177 if outputs: |
178 raise Exception('\n'.join(outputs)) | 178 # Directly raising Exception will have stderr outputs tied to the line |
| 179 # number of the script, so use sys.stderr.write() instead. |
| 180 # Add a trailing newline to supress new line checking errors. |
| 181 sys.stderr.write('\n'.join(['Exception:'] + outputs + ['\n'])) |
| 182 exit(1) |
179 | 183 |
180 | 184 |
181 def main(): | 185 def main(): |
182 """Parses command line and checks bench expectations.""" | 186 """Parses command line and checks bench expectations.""" |
183 try: | 187 try: |
184 opts, _ = getopt.getopt(sys.argv[1:], | 188 opts, _ = getopt.getopt(sys.argv[1:], |
185 "a:b:d:e:r:", | 189 "a:b:d:e:r:", |
186 "default-setting=") | 190 "default-setting=") |
187 except getopt.GetoptError, err: | 191 except getopt.GetoptError, err: |
188 print str(err) | 192 print str(err) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 data_points = bench_util.parse_skp_bench_data(directory, rev, rep) | 227 data_points = bench_util.parse_skp_bench_data(directory, rev, rep) |
224 | 228 |
225 bench_dict = create_bench_dict(data_points) | 229 bench_dict = create_bench_dict(data_points) |
226 | 230 |
227 if bench_expectations: | 231 if bench_expectations: |
228 check_expectations(bench_dict, bench_expectations, platform_and_alg) | 232 check_expectations(bench_dict, bench_expectations, platform_and_alg) |
229 | 233 |
230 | 234 |
231 if __name__ == "__main__": | 235 if __name__ == "__main__": |
232 main() | 236 main() |
OLD | NEW |