OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium 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 """ Prepare runtime resources that are needed by Test builders but not | 6 """ Prepare runtime resources that are needed by Test builders but not |
7 Bench builders. """ | 7 Bench builders. """ |
8 | 8 |
9 from build_step import BuildStep | 9 from build_step import BuildStep |
10 from utils import shell_utils | 10 from utils import shell_utils |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 self._device_dirs.SKImageExpectedDir()) | 126 self._device_dirs.SKImageExpectedDir()) |
127 skimage_expected_filename = builder_name_schema.GetWaterfallBot( | 127 skimage_expected_filename = builder_name_schema.GetWaterfallBot( |
128 self._builder_name) + ".json" | 128 self._builder_name) + ".json" |
129 | 129 |
130 skimage_host_expectations = os.path.join(self._skimage_expected_dir, | 130 skimage_host_expectations = os.path.join(self._skimage_expected_dir, |
131 skimage_expected_filename) | 131 skimage_expected_filename) |
132 | 132 |
133 if os.path.exists(skimage_host_expectations): | 133 if os.path.exists(skimage_host_expectations): |
134 skimage_device_expectations = self._flavor_utils.DevicePathJoin( | 134 skimage_device_expectations = self._flavor_utils.DevicePathJoin( |
135 self._device_dirs.SKImageExpectedDir(), skimage_expected_filename) | 135 self._device_dirs.SKImageExpectedDir(), skimage_expected_filename) |
136 self._flavor_utils.PushFileToDevice(skimage_host_expectations, | 136 # For builders without an attached device, PushFileToDevice will fail |
137 skimage_device_expectations) | 137 # when attempting to copy a file to itself. In this case, there is no |
| 138 # need to copy. Only do the push when there is an attached device, |
| 139 # which corresponds to the case that the filepaths are equal. |
| 140 # TODO(scroggo): Once |
| 141 # https://code.google.com/p/skia/issues/detail?id=1571 is fixed, this |
| 142 # check can go away. |
| 143 if skimage_device_expectations != skimage_host_expectations: |
| 144 self._flavor_utils.PushFileToDevice(skimage_host_expectations, |
| 145 skimage_device_expectations) |
138 | 146 |
139 self._flavor_utils.CopyDirectoryContentsToDevice( | 147 self._flavor_utils.CopyDirectoryContentsToDevice( |
140 self._skimage_in_dir, self._device_dirs.SKImageInDir()) | 148 self._skimage_in_dir, self._device_dirs.SKImageInDir()) |
141 | 149 |
142 | 150 |
143 # Create a directory for the output of skimage | 151 # Create a directory for the output of skimage |
144 self._flavor_utils.CreateCleanHostDirectory(self._skimage_out_dir) | 152 self._flavor_utils.CreateCleanHostDirectory(self._skimage_out_dir) |
145 self._flavor_utils.CreateCleanDeviceDirectory( | 153 self._flavor_utils.CreateCleanDeviceDirectory( |
146 self._device_dirs.SKImageOutDir()) | 154 self._device_dirs.SKImageOutDir()) |
147 | 155 |
148 | 156 |
149 if '__main__' == __name__: | 157 if '__main__' == __name__: |
150 sys.exit(BuildStep.RunBuildStep(PreRender)) | 158 sys.exit(BuildStep.RunBuildStep(PreRender)) |
OLD | NEW |