| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 """ | 148 """ |
| 149 return self.must_match(self.built_file_path(name, **kw), contents) | 149 return self.must_match(self.built_file_path(name, **kw), contents) |
| 150 | 150 |
| 151 def built_file_must_not_match(self, name, contents, **kw): | 151 def built_file_must_not_match(self, name, contents, **kw): |
| 152 """ | 152 """ |
| 153 Fails the test if the contents of the specified built file name | 153 Fails the test if the contents of the specified built file name |
| 154 match the specified contents. | 154 match the specified contents. |
| 155 """ | 155 """ |
| 156 return self.must_not_match(self.built_file_path(name, **kw), contents) | 156 return self.must_not_match(self.built_file_path(name, **kw), contents) |
| 157 | 157 |
| 158 def built_file_must_not_contain(self, name, contents, **kw): |
| 159 """ |
| 160 Fails the test if the specified built file name contains the specified |
| 161 contents. |
| 162 """ |
| 163 return self.must_not_contain(self.built_file_path(name, **kw), contents) |
| 164 |
| 158 def copy_test_configuration(self, source_dir, dest_dir): | 165 def copy_test_configuration(self, source_dir, dest_dir): |
| 159 """ | 166 """ |
| 160 Copies the test configuration from the specified source_dir | 167 Copies the test configuration from the specified source_dir |
| 161 (the directory in which the test script lives) to the | 168 (the directory in which the test script lives) to the |
| 162 specified dest_dir (a temporary working directory). | 169 specified dest_dir (a temporary working directory). |
| 163 | 170 |
| 164 This ignores all files and directories that begin with | 171 This ignores all files and directories that begin with |
| 165 the string 'gyptest', and all '.svn' subdirectories. | 172 the string 'gyptest', and all '.svn' subdirectories. |
| 166 """ | 173 """ |
| 167 for root, dirs, files in os.walk(source_dir): | 174 for root, dirs, files in os.walk(source_dir): |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 | 993 |
| 987 def TestGyp(*args, **kw): | 994 def TestGyp(*args, **kw): |
| 988 """ | 995 """ |
| 989 Returns an appropriate TestGyp* instance for a specified GYP format. | 996 Returns an appropriate TestGyp* instance for a specified GYP format. |
| 990 """ | 997 """ |
| 991 format = kw.pop('format', os.environ.get('TESTGYP_FORMAT')) | 998 format = kw.pop('format', os.environ.get('TESTGYP_FORMAT')) |
| 992 for format_class in format_class_list: | 999 for format_class in format_class_list: |
| 993 if format == format_class.format: | 1000 if format == format_class.format: |
| 994 return format_class(*args, **kw) | 1001 return format_class(*args, **kw) |
| 995 raise Exception, "unknown format %r" % format | 1002 raise Exception, "unknown format %r" % format |
| OLD | NEW |