OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2016 the V8 project authors. All rights reserved. | 2 # Copyright 2016 the V8 project authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """ | 6 """ |
7 V8 correctness fuzzer launcher script. | 7 V8 correctness fuzzer launcher script. |
8 """ | 8 """ |
9 | 9 |
10 import argparse | 10 import argparse |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 def main(): | 195 def main(): |
196 options = parse_args() | 196 options = parse_args() |
197 | 197 |
198 # Suppressions are architecture and configuration specific. | 198 # Suppressions are architecture and configuration specific. |
199 suppress = v8_suppressions.get_suppression( | 199 suppress = v8_suppressions.get_suppression( |
200 options.first_arch, options.first_config, | 200 options.first_arch, options.first_config, |
201 options.second_arch, options.second_config, | 201 options.second_arch, options.second_config, |
202 ) | 202 ) |
203 | 203 |
204 # Get metadata. | 204 # Get metadata. |
| 205 # TODO(machenbach): We probably don't need the metadata file anymore |
| 206 # now that the metadata is printed in the test cases. |
205 with open(options.meta_data_path) as f: | 207 with open(options.meta_data_path) as f: |
206 metadata = json.load(f) | 208 metadata = json.load(f) |
207 | 209 |
208 if metadata_bailout(metadata, suppress.ignore_by_metadata): | 210 if metadata_bailout(metadata, suppress.ignore_by_metadata): |
209 return RETURN_FAIL | 211 return RETURN_FAIL |
210 | 212 |
211 if test_pattern_bailout(options.testcase, suppress.ignore_by_content): | 213 if test_pattern_bailout(options.testcase, suppress.ignore_by_content): |
212 return RETURN_FAIL | 214 return RETURN_FAIL |
213 | 215 |
214 common_flags = FLAGS + ['--random-seed', str(options.random_seed)] | 216 common_flags = FLAGS + ['--random-seed', str(options.random_seed)] |
(...skipping 20 matching lines...) Expand all Loading... |
235 return RETURN_FAIL | 237 return RETURN_FAIL |
236 | 238 |
237 second_config_output = run_d8(options.second_d8, second_config_flags) | 239 second_config_output = run_d8(options.second_d8, second_config_flags) |
238 | 240 |
239 # Bailout based on second run's output. | 241 # Bailout based on second run's output. |
240 if pass_bailout(second_config_output, 2): | 242 if pass_bailout(second_config_output, 2): |
241 return RETURN_PASS | 243 return RETURN_PASS |
242 if fail_bailout(second_config_output, suppress.ignore_by_output2): | 244 if fail_bailout(second_config_output, suppress.ignore_by_output2): |
243 return RETURN_FAIL | 245 return RETURN_FAIL |
244 | 246 |
245 difference = suppress.diff( | 247 difference, source = suppress.diff( |
246 first_config_output.stdout, second_config_output.stdout) | 248 first_config_output.stdout, second_config_output.stdout) |
247 if difference: | 249 if difference: |
248 # The first three entries will be parsed by clusterfuzz. Format changes | 250 # The first three entries will be parsed by clusterfuzz. Format changes |
249 # will require changes on the clusterfuzz side. | 251 # will require changes on the clusterfuzz side. |
250 first_config_label = '%s,%s' % (options.first_arch, options.first_config) | 252 first_config_label = '%s,%s' % (options.first_arch, options.first_config) |
251 second_config_label = '%s,%s' % (options.second_arch, options.second_config) | 253 second_config_label = '%s,%s' % (options.second_arch, options.second_config) |
252 hsh = lambda x: hashlib.sha1(x).hexdigest()[:8] | |
253 print FAILURE_TEMPLATE % dict( | 254 print FAILURE_TEMPLATE % dict( |
254 configs='%s:%s' % (first_config_label, second_config_label), | 255 configs='%s:%s' % (first_config_label, second_config_label), |
255 sources=','.join(map(hsh, metadata['sources'])), | 256 sources=hashlib.sha1(source).hexdigest()[:8], |
256 suppression='', # We can't tie bugs to differences. | 257 suppression='', # We can't tie bugs to differences. |
257 first_config_label=first_config_label, | 258 first_config_label=first_config_label, |
258 second_config_label=second_config_label, | 259 second_config_label=second_config_label, |
259 first_config_flags=' '.join(first_config_flags), | 260 first_config_flags=' '.join(first_config_flags), |
260 second_config_flags=' '.join(second_config_flags), | 261 second_config_flags=' '.join(second_config_flags), |
261 first_config_output=first_config_output.stdout, | 262 first_config_output=first_config_output.stdout, |
262 second_config_output=second_config_output.stdout, | 263 second_config_output=second_config_output.stdout, |
263 difference=difference, | 264 difference=difference, |
264 ) | 265 ) |
265 return RETURN_FAIL | 266 return RETURN_FAIL |
(...skipping 16 matching lines...) Expand all Loading... |
282 configs='', sources='', suppression='wrong_usage') | 283 configs='', sources='', suppression='wrong_usage') |
283 result = RETURN_FAIL | 284 result = RETURN_FAIL |
284 except Exception as e: | 285 except Exception as e: |
285 print FAILURE_HEADER_TEMPLATE % dict( | 286 print FAILURE_HEADER_TEMPLATE % dict( |
286 configs='', sources='', suppression='internal_error') | 287 configs='', sources='', suppression='internal_error') |
287 print '# Internal error: %s' % e | 288 print '# Internal error: %s' % e |
288 traceback.print_exc(file=sys.stdout) | 289 traceback.print_exc(file=sys.stdout) |
289 result = RETURN_FAIL | 290 result = RETURN_FAIL |
290 | 291 |
291 sys.exit(result) | 292 sys.exit(result) |
OLD | NEW |