| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 self.buckets = buckets_before + [first_half, second_half] + buckets_afte
r | 139 self.buckets = buckets_before + [first_half, second_half] + buckets_afte
r |
| 140 | 140 |
| 141 def test_bucket_list_fails(self, buckets): | 141 def test_bucket_list_fails(self, buckets): |
| 142 tests = [] | 142 tests = [] |
| 143 for bucket in buckets: | 143 for bucket in buckets: |
| 144 tests += bucket.tests | 144 tests += bucket.tests |
| 145 return self.test_fails(tests) | 145 return self.test_fails(tests) |
| 146 | 146 |
| 147 def test_fails(self, tests): | 147 def test_fails(self, tests): |
| 148 extra_args = ['--debug'] if self.is_debug else [] | 148 extra_args = ['--debug'] if self.is_debug else [] |
| 149 path_to_run_webkit_tests = self.webkit_finder.path_from_webkit_base('Too
ls', 'Scripts', 'run-webkit-tests') | 149 path_to_run_webkit_tests = self.webkit_finder.path_from_webkit_base('too
ls', 'test_sky') |
| 150 output = self.executive.popen([path_to_run_webkit_tests, '--child-proces
ses', '1', '--order', 'none', '--no-retry', '--no-show-results', '--verbose'] +
extra_args + tests, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | 150 output = self.executive.popen([path_to_run_webkit_tests, '--child-proces
ses', '1', '--order', 'none', '--no-retry', '--no-show-results', '--verbose'] +
extra_args + tests, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 151 failure_string = self.expected_failure + ' failed' | 151 failure_string = self.expected_failure + ' failed' |
| 152 if failure_string in output.stderr.read(): | 152 if failure_string in output.stderr.read(): |
| 153 return True | 153 return True |
| 154 return False | 154 return False |
| 155 | 155 |
| 156 | 156 |
| 157 def main(argv): | 157 def main(argv): |
| 158 logging.basicConfig() | 158 logging.basicConfig() |
| 159 | 159 |
| 160 option_parser = optparse.OptionParser() | 160 option_parser = optparse.OptionParser() |
| 161 option_parser.add_option('--test-list', action='store', help='file that list
tests to bisect. The last test in the list is the expected failure.', metavar='
FILE'), | 161 option_parser.add_option('--test-list', action='store', help='file that list
tests to bisect. The last test in the list is the expected failure.', metavar='
FILE'), |
| 162 option_parser.add_option('--debug', action='store_true', default=False, help
='whether to use a debug build'), | 162 option_parser.add_option('--debug', action='store_true', default=False, help
='whether to use a debug build'), |
| 163 options, args = option_parser.parse_args(argv) | 163 options, args = option_parser.parse_args(argv) |
| 164 | 164 |
| 165 tests = open(options.test_list).read().strip().split('\n') | 165 tests = open(options.test_list).read().strip().split('\n') |
| 166 bisector = Bisector(tests, is_debug=options.debug) | 166 bisector = Bisector(tests, is_debug=options.debug) |
| 167 return bisector.bisect() | 167 return bisector.bisect() |
| 168 | 168 |
| 169 if __name__ == '__main__': | 169 if __name__ == '__main__': |
| 170 sys.exit(main(sys.argv[1:])) | 170 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |