OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2012 Google Inc. All rights reserved. | 3 # Copyright (c) 2012 Google Inc. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 __doc__ = """ | 7 __doc__ = """ |
8 gyptest.py -- test runner for GYP tests. | 8 gyptest.py -- test runner for GYP tests. |
9 """ | 9 """ |
10 | 10 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 parser.add_option("-q", "--quiet", action="store_true", | 169 parser.add_option("-q", "--quiet", action="store_true", |
170 help="quiet, don't print test command lines") | 170 help="quiet, don't print test command lines") |
171 opts, args = parser.parse_args(argv[1:]) | 171 opts, args = parser.parse_args(argv[1:]) |
172 | 172 |
173 if opts.chdir: | 173 if opts.chdir: |
174 os.chdir(opts.chdir) | 174 os.chdir(opts.chdir) |
175 | 175 |
176 if opts.path: | 176 if opts.path: |
177 extra_path = [os.path.abspath(p) for p in opts.path] | 177 extra_path = [os.path.abspath(p) for p in opts.path] |
178 extra_path = os.pathsep.join(extra_path) | 178 extra_path = os.pathsep.join(extra_path) |
179 os.environ['PATH'] += os.pathsep + extra_path | 179 os.environ['PATH'] = extra_path + os.pathsep + os.environ['PATH'] |
180 | 180 |
181 if not args: | 181 if not args: |
182 if not opts.all: | 182 if not opts.all: |
183 sys.stderr.write('Specify -a to get all tests.\n') | 183 sys.stderr.write('Specify -a to get all tests.\n') |
184 return 1 | 184 return 1 |
185 args = ['test'] | 185 args = ['test'] |
186 | 186 |
187 tests = [] | 187 tests = [] |
188 for arg in args: | 188 for arg in args: |
189 if os.path.isdir(arg): | 189 if os.path.isdir(arg): |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 report("No result from", no_result) | 265 report("No result from", no_result) |
266 | 266 |
267 if failed: | 267 if failed: |
268 return 1 | 268 return 1 |
269 else: | 269 else: |
270 return 0 | 270 return 0 |
271 | 271 |
272 | 272 |
273 if __name__ == "__main__": | 273 if __name__ == "__main__": |
274 sys.exit(main()) | 274 sys.exit(main()) |
OLD | NEW |