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 """Reads a manifest, creates a tree of hardlinks and runs the test. | 6 """Reads a manifest, creates a tree of hardlinks and runs the test. |
7 | 7 |
8 Keeps a local cache. | 8 Keeps a local cache. |
9 """ | 9 """ |
10 | 10 |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 if 'mode' in properties: | 258 if 'mode' in properties: |
259 # It's not set on Windows. | 259 # It's not set on Windows. |
260 os.chmod(outfile, properties['mode']) | 260 os.chmod(outfile, properties['mode']) |
261 | 261 |
262 cwd = os.path.join(outdir, manifest['relative_cwd']) | 262 cwd = os.path.join(outdir, manifest['relative_cwd']) |
263 if not os.path.isdir(cwd): | 263 if not os.path.isdir(cwd): |
264 os.makedirs(cwd) | 264 os.makedirs(cwd) |
265 if manifest.get('read_only'): | 265 if manifest.get('read_only'): |
266 make_writable(outdir, True) | 266 make_writable(outdir, True) |
267 cmd = manifest['command'] | 267 cmd = manifest['command'] |
| 268 # Ensure paths are correctly separatored on windows. |
| 269 cmd[0] = cmd[0].replace('/', os.path.sep) |
268 logging.info('Running %s, cwd=%s' % (cmd, cwd)) | 270 logging.info('Running %s, cwd=%s' % (cmd, cwd)) |
269 return subprocess.call(cmd, cwd=cwd) | 271 return subprocess.call(cmd, cwd=cwd) |
270 finally: | 272 finally: |
271 # Save first, in case an exception occur in the following lines, then clean | 273 # Save first, in case an exception occur in the following lines, then clean |
272 # up. | 274 # up. |
273 cache.save() | 275 cache.save() |
274 rmtree(outdir) | 276 rmtree(outdir) |
275 cache.trim() | 277 cache.trim() |
276 | 278 |
277 | 279 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 parser.error('Unsupported args %s' % ' '.join(args)) | 322 parser.error('Unsupported args %s' % ' '.join(args)) |
321 | 323 |
322 manifest = json.load(open_remote(options.manifest)) | 324 manifest = json.load(open_remote(options.manifest)) |
323 return run_tha_test( | 325 return run_tha_test( |
324 manifest, os.path.abspath(options.cache), options.remote, | 326 manifest, os.path.abspath(options.cache), options.remote, |
325 options.max_cache_size, options.min_free_space) | 327 options.max_cache_size, options.min_free_space) |
326 | 328 |
327 | 329 |
328 if __name__ == '__main__': | 330 if __name__ == '__main__': |
329 sys.exit(main()) | 331 sys.exit(main()) |
OLD | NEW |