Changeset 92669 in webkit
- Timestamp:
- Aug 9, 2011 1:38:45 AM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r92660 r92669 1 2011-08-09 Adam Barth <abarth@webkit.org> 2 3 BaselineOptimizer created the wrong baseline for fast/js/regexp-overflow.html 4 https://bugs.webkit.org/show_bug.cgi?id=65891 5 6 Reviewed by Eric Seidel. 7 8 The problem was that platform/chromium contained a bogus expectation 9 file that needed to be removed, but by the time we got around to 10 removing it, we'd already moved the correct baseline into its place. 11 After this patch, we copy the gold results into memory before 12 reshuffling things on disk (and we delete bad things before adding good 13 things). 14 15 * Scripts/webkitpy/common/checkout/baselineoptimizer.py: 16 * Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py: 17 1 18 2011-08-08 Adam Barth <abarth@webkit.org> 2 19 -
trunk/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py
r92562 r92669 133 133 134 134 def _move_baselines(self, baseline_name, results_by_directory, new_results_by_directory): 135 source_directory_for_result = {}135 data_for_result = {} 136 136 for directory, result in results_by_directory.items(): 137 source_directory_for_result[result] = directory 138 139 for directory, result in new_results_by_directory.items(): 140 if results_by_directory.get(directory) != result: 141 source = self._filesystem.join(self._scm.checkout_root, source_directory_for_result[result], baseline_name) 142 destination = self._filesystem.join(self._scm.checkout_root, directory, baseline_name) 143 self._filesystem.maybe_make_directory(self._filesystem.split(destination)[0]) 144 self._filesystem.copyfile(source, destination) 145 self._scm.add(destination) 137 if not result in data_for_result: 138 source = self._filesystem.join(self._scm.checkout_root, directory, baseline_name) 139 data_for_result[result] = self._filesystem.read_binary_file(source) 146 140 147 141 for directory, result in results_by_directory.items(): … … 149 143 file_name = self._filesystem.join(self._scm.checkout_root, directory, baseline_name) 150 144 self._scm.delete(file_name) 151 # FIXME: Check for empty directories and remove them as well. 145 146 for directory, result in new_results_by_directory.items(): 147 if results_by_directory.get(directory) != result: 148 destination = self._filesystem.join(self._scm.checkout_root, directory, baseline_name) 149 self._filesystem.maybe_make_directory(self._filesystem.split(destination)[0]) 150 self._filesystem.write_binary_file(destination, data_for_result[result]) 151 self._scm.add(destination) 152 152 153 153 def optimize(self, baseline_name): -
trunk/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py
r92562 r92669 50 50 _, new_results_by_directory = baseline_optimizer._find_optimal_result_placement('mock-baseline.png') 51 51 self.assertEqual(new_results_by_directory, expected_new_results_by_directory) 52 53 def test_move_baselines(self): 54 fs = MockFileSystem() 55 fs.write_binary_file('/mock-checkout/LayoutTests/platform/chromium-win/another/test-expected.txt', 'result A') 56 fs.write_binary_file('/mock-checkout/LayoutTests/platform/chromium-mac/another/test-expected.txt', 'result A') 57 fs.write_binary_file('/mock-checkout/LayoutTests/platform/chromium/another/test-expected.txt', 'result B') 58 baseline_optimizer = BaselineOptimizer(MockSCM(), fs) 59 baseline_optimizer._move_baselines('another/test-expected.txt', { 60 'LayoutTests/platform/chromium-win': 'aaa', 61 'LayoutTests/platform/chromium-mac': 'aaa', 62 'LayoutTests/platform/chromium': 'bbb', 63 }, { 64 'LayoutTests/platform/chromium': 'aaa', 65 }) 66 self.assertEqual(fs.read_binary_file('/mock-checkout/LayoutTests/platform/chromium/another/test-expected.txt'), 'result A') 52 67 53 68 def test_chromium_linux_redundant_with_win(self):
Note: See TracChangeset
for help on using the changeset viewer.