| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2008 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 # chrome_tests.py | 6 # chrome_tests.py |
| 7 | 7 |
| 8 ''' Runs various chrome tests through valgrind_test.py. | 8 ''' Runs various chrome tests through valgrind_test.py. |
| 9 | 9 |
| 10 This file is a copy of ../purify/chrome_tests.py. Eventually, it would be nice | 10 This file is a copy of ../purify/chrome_tests.py. Eventually, it would be nice |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 if os.path.exists(suppression_file): | 129 if os.path.exists(suppression_file): |
| 130 cmd.append("--suppressions=%s" % suppression_file) | 130 cmd.append("--suppressions=%s" % suppression_file) |
| 131 if self._options.baseline: | 131 if self._options.baseline: |
| 132 cmd.append("--baseline") | 132 cmd.append("--baseline") |
| 133 if self._options.verbose: | 133 if self._options.verbose: |
| 134 cmd.append("--verbose") | 134 cmd.append("--verbose") |
| 135 if self._options.show_all_leaks: | 135 if self._options.show_all_leaks: |
| 136 cmd.append("--show_all_leaks") | 136 cmd.append("--show_all_leaks") |
| 137 if self._options.generate_suppressions: | 137 if self._options.generate_suppressions: |
| 138 cmd.append("--generate_suppressions") | 138 cmd.append("--generate_suppressions") |
| 139 if exe == "ui_tests": |
| 140 cmd.append("--trace_children") |
| 141 cmd.append("--indirect") |
| 139 if exe: | 142 if exe: |
| 140 cmd.append(os.path.join(self._options.build_dir, exe)) | 143 cmd.append(os.path.join(self._options.build_dir, exe)) |
| 141 # Valgrind runs tests slowly, so slow tests hurt more; show elapased time | 144 # Valgrind runs tests slowly, so slow tests hurt more; show elapased time |
| 142 # so we can find the slowpokes. | 145 # so we can find the slowpokes. |
| 143 cmd.append("--gtest_print_time"); | 146 cmd.append("--gtest_print_time"); |
| 144 return cmd | 147 return cmd |
| 145 | 148 |
| 146 def Run(self): | 149 def Run(self): |
| 147 ''' Runs the test specified by command-line argument --test ''' | 150 ''' Runs the test specified by command-line argument --test ''' |
| 148 logging.info("running test %s" % (self._test)) | 151 logging.info("running test %s" % (self._test)) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 167 if gtest_filter: | 170 if gtest_filter: |
| 168 gtest_filter += ":" | 171 gtest_filter += ":" |
| 169 if gtest_filter.find("-") < 0: | 172 if gtest_filter.find("-") < 0: |
| 170 gtest_filter += "-" | 173 gtest_filter += "-" |
| 171 else: | 174 else: |
| 172 gtest_filter = "-" | 175 gtest_filter = "-" |
| 173 gtest_filter += ":".join(filters) | 176 gtest_filter += ":".join(filters) |
| 174 if gtest_filter: | 177 if gtest_filter: |
| 175 cmd.append("--gtest_filter=%s" % gtest_filter) | 178 cmd.append("--gtest_filter=%s" % gtest_filter) |
| 176 | 179 |
| 177 def SimpleTest(self, module, name): | 180 def SimpleTest(self, module, name, cmd_args=None): |
| 178 cmd = self._DefaultCommand(module, name) | 181 cmd = self._DefaultCommand(module, name) |
| 179 self._ReadGtestFilterFile(name, cmd) | 182 self._ReadGtestFilterFile(name, cmd) |
| 183 if cmd_args: |
| 184 cmd.extend(cmd_args) |
| 180 return common.RunSubprocess(cmd, 0) | 185 return common.RunSubprocess(cmd, 0) |
| 181 | 186 |
| 182 def ScriptedTest(self, module, exe, name, script, multi=False, cmd_args=None, | 187 def ScriptedTest(self, module, exe, name, script, multi=False, cmd_args=None, |
| 183 out_dir_extra=None): | 188 out_dir_extra=None): |
| 184 '''Valgrind a target binary, which will be executed one or more times via a | 189 '''Valgrind a target binary, which will be executed one or more times via a |
| 185 script or driver program. | 190 script or driver program. |
| 186 Args: | 191 Args: |
| 187 module - which top level component this test is from (webkit, base, etc.) | 192 module - which top level component this test is from (webkit, base, etc.) |
| 188 exe - the name of the exe (it's assumed to exist in build_dir) | 193 exe - the name of the exe (it's assumed to exist in build_dir) |
| 189 name - the name of this test (used to name output files) | 194 name - the name of this test (used to name output files) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 def TestNet(self): | 243 def TestNet(self): |
| 239 return self.SimpleTest("net", "net_unittests") | 244 return self.SimpleTest("net", "net_unittests") |
| 240 | 245 |
| 241 def TestTestShell(self): | 246 def TestTestShell(self): |
| 242 return self.SimpleTest("webkit", "test_shell_tests") | 247 return self.SimpleTest("webkit", "test_shell_tests") |
| 243 | 248 |
| 244 def TestUnit(self): | 249 def TestUnit(self): |
| 245 return self.SimpleTest("chrome", "unit_tests") | 250 return self.SimpleTest("chrome", "unit_tests") |
| 246 | 251 |
| 247 def TestUI(self): | 252 def TestUI(self): |
| 248 return self.SimpleTest("chrome", "ui_tests") | 253 return self.SimpleTest("chrome", "ui_tests", |
| 254 cmd_args=["--", |
| 255 "--ui-test-timeout=120000", |
| 256 "--ui-test-action-timeout=80000", |
| 257 "--ui-test-action-max-timeout=180000"]) |
| 249 | 258 |
| 250 # def TestLayoutAll(self): | 259 # def TestLayoutAll(self): |
| 251 # return self.TestLayout(run_all=True) | 260 # return self.TestLayout(run_all=True) |
| 252 | 261 |
| 253 # def TestLayout(self, run_all=False): | 262 # def TestLayout(self, run_all=False): |
| 254 # # A "chunk file" is maintained in the local directory so that each test | 263 # # A "chunk file" is maintained in the local directory so that each test |
| 255 # # runs a slice of the layout tests of size chunk_size that increments with | 264 # # runs a slice of the layout tests of size chunk_size that increments with |
| 256 # # each run. Since tests can be added and removed from the layout tests at | 265 # # each run. Since tests can be added and removed from the layout tests at |
| 257 # # any time, this is not going to give exact coverage, but it will allow us | 266 # # any time, this is not going to give exact coverage, but it will allow us |
| 258 # # to continuously run small slices of the layout tests under purify rather | 267 # # to continuously run small slices of the layout tests under purify rather |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 for t in options.test: | 379 for t in options.test: |
| 371 tests = ChromeTests(options, args, t) | 380 tests = ChromeTests(options, args, t) |
| 372 ret = tests.Run() | 381 ret = tests.Run() |
| 373 if ret: return ret | 382 if ret: return ret |
| 374 return 0 | 383 return 0 |
| 375 | 384 |
| 376 | 385 |
| 377 if __name__ == "__main__": | 386 if __name__ == "__main__": |
| 378 ret = _main(sys.argv) | 387 ret = _main(sys.argv) |
| 379 sys.exit(ret) | 388 sys.exit(ret) |
| OLD | NEW |