OLD | NEW |
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 # method below that 'devenv' was not found on %PATH%. | 778 # method below that 'devenv' was not found on %PATH%. |
779 # | 779 # |
780 # Note: we must use devenv.com to be able to capture build output. | 780 # Note: we must use devenv.com to be able to capture build output. |
781 # Directly executing devenv.exe only sends output to BuildLog.htm. | 781 # Directly executing devenv.exe only sends output to BuildLog.htm. |
782 build_tool_list = [None, 'devenv.com'] | 782 build_tool_list = [None, 'devenv.com'] |
783 | 783 |
784 def initialize_build_tool(self): | 784 def initialize_build_tool(self): |
785 super(TestGypMSVS, self).initialize_build_tool() | 785 super(TestGypMSVS, self).initialize_build_tool() |
786 self.build_tool = self.devenv_path | 786 self.build_tool = self.devenv_path |
787 | 787 |
788 def build(self, gyp_file, target=None, rebuild=False, **kw): | 788 def build(self, gyp_file, target=None, rebuild=False, clean=False, **kw): |
789 """ | 789 """ |
790 Runs a Visual Studio build using the configuration generated | 790 Runs a Visual Studio build using the configuration generated |
791 from the specified gyp_file. | 791 from the specified gyp_file. |
792 """ | 792 """ |
793 configuration = self.configuration_buildname() | 793 configuration = self.configuration_buildname() |
794 if rebuild: | 794 if clean: |
| 795 build = '/Clean' |
| 796 elif rebuild: |
795 build = '/Rebuild' | 797 build = '/Rebuild' |
796 else: | 798 else: |
797 build = '/Build' | 799 build = '/Build' |
798 arguments = kw.get('arguments', [])[:] | 800 arguments = kw.get('arguments', [])[:] |
799 arguments.extend([gyp_file.replace('.gyp', '.sln'), | 801 arguments.extend([gyp_file.replace('.gyp', '.sln'), |
800 build, configuration]) | 802 build, configuration]) |
801 # Note: the Visual Studio generator doesn't add an explicit 'all' | 803 # Note: the Visual Studio generator doesn't add an explicit 'all' |
802 # target, so we just treat it the same as the default. | 804 # target, so we just treat it the same as the default. |
803 if target not in (None, self.ALL, self.DEFAULT): | 805 if target not in (None, self.ALL, self.DEFAULT): |
804 arguments.extend(['/Project', target]) | 806 arguments.extend(['/Project', target]) |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 | 1059 |
1058 def TestGyp(*args, **kw): | 1060 def TestGyp(*args, **kw): |
1059 """ | 1061 """ |
1060 Returns an appropriate TestGyp* instance for a specified GYP format. | 1062 Returns an appropriate TestGyp* instance for a specified GYP format. |
1061 """ | 1063 """ |
1062 format = kw.pop('format', os.environ.get('TESTGYP_FORMAT')) | 1064 format = kw.pop('format', os.environ.get('TESTGYP_FORMAT')) |
1063 for format_class in format_class_list: | 1065 for format_class in format_class_list: |
1064 if format == format_class.format: | 1066 if format == format_class.format: |
1065 return format_class(*args, **kw) | 1067 return format_class(*args, **kw) |
1066 raise Exception, "unknown format %r" % format | 1068 raise Exception, "unknown format %r" % format |
OLD | NEW |