| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 '--first-config', help='first configuration', default='fullcode') | 94 '--first-config', help='first configuration', default='fullcode') |
| 95 parser.add_argument( | 95 parser.add_argument( |
| 96 '--second-config', help='second configuration', default='fullcode') | 96 '--second-config', help='second configuration', default='fullcode') |
| 97 parser.add_argument( | 97 parser.add_argument( |
| 98 '--first-d8', default='d8', | 98 '--first-d8', default='d8', |
| 99 help='optional path to first d8 executable, ' | 99 help='optional path to first d8 executable, ' |
| 100 'default: bundled in the same directory as this script') | 100 'default: bundled in the same directory as this script') |
| 101 parser.add_argument( | 101 parser.add_argument( |
| 102 '--second-d8', | 102 '--second-d8', |
| 103 help='optional path to second d8 executable, default: same as first') | 103 help='optional path to second d8 executable, default: same as first') |
| 104 parser.add_argument('testcase', help='path to test case', nargs='?') | 104 parser.add_argument('testcase', help='path to test case') |
| 105 options = parser.parse_args() | 105 options = parser.parse_args() |
| 106 | 106 |
| 107 if not options.testcase: | |
| 108 # Don't check further as we want to bail out early without test case. | |
| 109 return options | |
| 110 | |
| 111 # Ensure we make a sane comparison. | 107 # Ensure we make a sane comparison. |
| 112 assert (options.first_arch != options.second_arch or | 108 assert (options.first_arch != options.second_arch or |
| 113 options.first_config != options.second_config) , ( | 109 options.first_config != options.second_config) , ( |
| 114 'Need either arch or config difference.') | 110 'Need either arch or config difference.') |
| 115 assert options.first_arch in SUPPORTED_ARCHS | 111 assert options.first_arch in SUPPORTED_ARCHS |
| 116 assert options.second_arch in SUPPORTED_ARCHS | 112 assert options.second_arch in SUPPORTED_ARCHS |
| 117 assert options.first_config in CONFIGS | 113 assert options.first_config in CONFIGS |
| 118 assert options.second_config in CONFIGS | 114 assert options.second_config in CONFIGS |
| 119 | 115 |
| 120 # Ensure we have a test case. | 116 # Ensure we have a test case. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 if bug: | 178 if bug: |
| 183 print FAILURE_HEADER_TEMPLATE % dict( | 179 print FAILURE_HEADER_TEMPLATE % dict( |
| 184 configs='', sources='', suppression=bug) | 180 configs='', sources='', suppression=bug) |
| 185 return True | 181 return True |
| 186 return False | 182 return False |
| 187 | 183 |
| 188 | 184 |
| 189 def main(): | 185 def main(): |
| 190 options = parse_args() | 186 options = parse_args() |
| 191 | 187 |
| 192 if not options.testcase: | |
| 193 print '# V8 correctness - pass - no test file given' | |
| 194 return RETURN_PASS | |
| 195 | |
| 196 # Suppressions are architecture and configuration specific. | 188 # Suppressions are architecture and configuration specific. |
| 197 suppress = v8_suppressions.get_suppression( | 189 suppress = v8_suppressions.get_suppression( |
| 198 options.first_arch, options.first_config, | 190 options.first_arch, options.first_config, |
| 199 options.second_arch, options.second_config, | 191 options.second_arch, options.second_config, |
| 200 ) | 192 ) |
| 201 | 193 |
| 202 if test_pattern_bailout(options.testcase, suppress.ignore): | 194 if test_pattern_bailout(options.testcase, suppress.ignore): |
| 203 return RETURN_FAIL | 195 return RETURN_FAIL |
| 204 | 196 |
| 205 # Get metadata. | 197 # Get metadata. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 configs='', sources='', suppression='wrong_usage') | 269 configs='', sources='', suppression='wrong_usage') |
| 278 result = RETURN_FAIL | 270 result = RETURN_FAIL |
| 279 except Exception as e: | 271 except Exception as e: |
| 280 print FAILURE_HEADER_TEMPLATE % dict( | 272 print FAILURE_HEADER_TEMPLATE % dict( |
| 281 configs='', sources='', suppression='internal_error') | 273 configs='', sources='', suppression='internal_error') |
| 282 print '# Internal error: %s' % e | 274 print '# Internal error: %s' % e |
| 283 traceback.print_exc(file=sys.stdout) | 275 traceback.print_exc(file=sys.stdout) |
| 284 result = RETURN_FAIL | 276 result = RETURN_FAIL |
| 285 | 277 |
| 286 sys.exit(result) | 278 sys.exit(result) |
| OLD | NEW |