OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 ''' Runs various chrome tests through valgrind_test.py.''' | 6 ''' Runs various chrome tests through valgrind_test.py.''' |
7 | 7 |
8 import glob | 8 import glob |
9 import logging | 9 import logging |
10 import optparse | 10 import optparse |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 build_dir = [d for d in dirs if os.path.isdir(d)] | 66 build_dir = [d for d in dirs if os.path.isdir(d)] |
67 if len(build_dir) > 1: | 67 if len(build_dir) > 1: |
68 raise BuildDirAmbiguous("Found more than one suitable build dir:\n" | 68 raise BuildDirAmbiguous("Found more than one suitable build dir:\n" |
69 "%s\nPlease specify just one " | 69 "%s\nPlease specify just one " |
70 "using --build_dir" % ", ".join(build_dir)) | 70 "using --build_dir" % ", ".join(build_dir)) |
71 elif build_dir: | 71 elif build_dir: |
72 self._options.build_dir = build_dir[0] | 72 self._options.build_dir = build_dir[0] |
73 else: | 73 else: |
74 self._options.build_dir = None | 74 self._options.build_dir = None |
75 | 75 |
| 76 if self._options.build_dir: |
| 77 build_dir = os.path.abspath(self._options.build_dir) |
| 78 self._command_preamble += ["--build_dir=%s" % (self._options.build_dir)] |
| 79 |
76 def _EnsureBuildDirFound(self): | 80 def _EnsureBuildDirFound(self): |
77 if not self._options.build_dir: | 81 if not self._options.build_dir: |
78 raise BuildDirNotFound("Oops, couldn't find a build dir, please " | 82 raise BuildDirNotFound("Oops, couldn't find a build dir, please " |
79 "specify it manually using --build_dir") | 83 "specify it manually using --build_dir") |
80 | 84 |
81 def _DefaultCommand(self, tool, exe=None, valgrind_test_args=None): | 85 def _DefaultCommand(self, tool, exe=None, valgrind_test_args=None): |
82 '''Generates the default command array that most tests will use.''' | 86 '''Generates the default command array that most tests will use.''' |
83 if exe and common.IsWindows(): | 87 if exe and common.IsWindows(): |
84 exe += '.exe' | 88 exe += '.exe' |
85 | 89 |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 | 506 |
503 for t in options.test: | 507 for t in options.test: |
504 tests = ChromeTests(options, args, t) | 508 tests = ChromeTests(options, args, t) |
505 ret = tests.Run() | 509 ret = tests.Run() |
506 if ret: return ret | 510 if ret: return ret |
507 return 0 | 511 return 0 |
508 | 512 |
509 | 513 |
510 if __name__ == "__main__": | 514 if __name__ == "__main__": |
511 sys.exit(_main()) | 515 sys.exit(_main()) |
OLD | NEW |