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