Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2011 Google Inc. All rights reserved. | 1 # Copyright (c) 2011 Google Inc. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """ | 5 """ |
| 6 TestGyp.py: a testing framework for GYP integration tests. | 6 TestGyp.py: a testing framework for GYP integration tests. |
| 7 """ | 7 """ |
| 8 | 8 |
| 9 import os | 9 import os |
| 10 import re | 10 import re |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 442 if target is None: | 442 if target is None: |
| 443 target = 'all' | 443 target = 'all' |
| 444 arguments.append(target) | 444 arguments.append(target) |
| 445 | 445 |
| 446 kw['arguments'] = arguments | 446 kw['arguments'] = arguments |
| 447 return self.run(program=self.build_tool, **kw) | 447 return self.run(program=self.build_tool, **kw) |
| 448 | 448 |
| 449 def run_built_executable(self, name, *args, **kw): | 449 def run_built_executable(self, name, *args, **kw): |
| 450 # Enclosing the name in a list avoids prepending the original dir. | 450 # Enclosing the name in a list avoids prepending the original dir. |
| 451 program = [self.built_file_path(name, type=self.EXECUTABLE, **kw)] | 451 program = [self.built_file_path(name, type=self.EXECUTABLE, **kw)] |
| 452 if sys.platform == 'darwin': | |
| 453 libdir = os.path.join('out', 'Default', 'lib') | |
| 454 if self.configuration: | |
| 455 libdir = os.path.join('out', self.configuration, 'lib') | |
| 456 os.environ['DYLD_LIBRARY_PATH'] = libdir | |
|
tony
2011/12/20 23:36:11
Why is this different from the make/xcodebuild?
Nico
2011/12/20 23:54:38
The make build runs its compilations from the sour
| |
| 452 return self.run(program=program, *args, **kw) | 457 return self.run(program=program, *args, **kw) |
| 453 | 458 |
| 454 def built_file_path(self, name, type=None, **kw): | 459 def built_file_path(self, name, type=None, **kw): |
| 455 result = [] | 460 result = [] |
| 456 chdir = kw.get('chdir') | 461 chdir = kw.get('chdir') |
| 457 if chdir: | 462 if chdir: |
| 458 result.append(chdir) | 463 result.append(chdir) |
| 459 result.append('out') | 464 result.append('out') |
| 460 result.append(self.configuration_dirname()) | 465 result.append(self.configuration_dirname()) |
| 461 if type in (self.STATIC_LIB,): | 466 if type == self.STATIC_LIB: |
| 462 result.append('obj') | 467 if sys.platform != 'darwin': |
|
tony
2011/12/20 23:36:11
Why is this different from the make/xcodebuild?
N
Nico
2011/12/20 23:54:38
It's not, make and xcodebuild both put their stati
| |
| 463 elif type in (self.SHARED_LIB,): | 468 result.append('obj') |
| 469 elif type == self.SHARED_LIB: | |
| 464 result.append('lib') | 470 result.append('lib') |
| 465 subdir = kw.get('subdir') | 471 subdir = kw.get('subdir') |
| 466 if subdir: | 472 if subdir: |
| 467 result.append(subdir) | 473 result.append(subdir) |
| 468 result.append(self.built_file_basename(name, type, **kw)) | 474 result.append(self.built_file_basename(name, type, **kw)) |
| 469 return self.workpath(*result) | 475 return self.workpath(*result) |
| 470 | 476 |
| 471 def up_to_date(self, gyp_file, target=None, **kw): | 477 def up_to_date(self, gyp_file, target=None, **kw): |
| 472 kw['stdout'] = "ninja: no work to do.\n" | 478 kw['stdout'] = "ninja: no work to do.\n" |
| 473 return self.build(gyp_file, target, **kw) | 479 return self.build(gyp_file, target, **kw) |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 797 """ | 803 """ |
| 798 format = kw.get('format') | 804 format = kw.get('format') |
| 799 if format: | 805 if format: |
| 800 del kw['format'] | 806 del kw['format'] |
| 801 else: | 807 else: |
| 802 format = os.environ.get('TESTGYP_FORMAT') | 808 format = os.environ.get('TESTGYP_FORMAT') |
| 803 for format_class in format_class_list: | 809 for format_class in format_class_list: |
| 804 if format == format_class.format: | 810 if format == format_class.format: |
| 805 return format_class(*args, **kw) | 811 return format_class(*args, **kw) |
| 806 raise Exception, "unknown format %r" % format | 812 raise Exception, "unknown format %r" % format |
| OLD | NEW |