OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium Authors. 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 ''' Runs various chrome tests through heapcheck_test.py. | 7 ''' Runs various chrome tests through heapcheck_test.py. |
8 | 8 |
9 Most of this code is copied from ../valgrind/chrome_tests.py. | 9 Most of this code is copied from ../valgrind/chrome_tests.py. |
10 TODO(glider): put common functions to a standalone module. | 10 TODO(glider): put common functions to a standalone module. |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 cmd = self._DefaultCommand(module, name, heapcheck_test_args) | 240 cmd = self._DefaultCommand(module, name, heapcheck_test_args) |
241 supp = self.Suppressions() | 241 supp = self.Suppressions() |
242 self._ReadGtestFilterFile(name, cmd) | 242 self._ReadGtestFilterFile(name, cmd) |
243 if cmd_args: | 243 if cmd_args: |
244 cmd.extend(["--"]) | 244 cmd.extend(["--"]) |
245 cmd.extend(cmd_args) | 245 cmd.extend(cmd_args) |
246 | 246 |
247 # Sets LD_LIBRARY_PATH to the build folder so external libraries can be | 247 # Sets LD_LIBRARY_PATH to the build folder so external libraries can be |
248 # loaded. | 248 # loaded. |
249 os.putenv("LD_LIBRARY_PATH", self._options.build_dir) | 249 os.putenv("LD_LIBRARY_PATH", self._options.build_dir) |
250 return heapcheck_test.RunTool(cmd, supp) | 250 return heapcheck_test.RunTool(cmd, supp, module) |
251 | 251 |
252 def TestBase(self): | 252 def TestBase(self): |
253 return self.SimpleTest("base", "base_unittests") | 253 return self.SimpleTest("base", "base_unittests") |
254 | 254 |
255 def TestBrowser(self): | 255 def TestBrowser(self): |
256 return self.SimpleTest("chrome", "browser_tests") | 256 return self.SimpleTest("chrome", "browser_tests") |
257 | 257 |
258 def TestGURL(self): | 258 def TestGURL(self): |
259 return self.SimpleTest("chrome", "googleurl_unittests") | 259 return self.SimpleTest("chrome", "googleurl_unittests") |
260 | 260 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 if os.path.isfile(self._args[0]) and self._args[0][-4:] == ".txt": | 342 if os.path.isfile(self._args[0]) and self._args[0][-4:] == ".txt": |
343 script_cmd.append("--test-list=%s" % self._args[0]) | 343 script_cmd.append("--test-list=%s" % self._args[0]) |
344 else: | 344 else: |
345 script_cmd.extend(self._args) | 345 script_cmd.extend(self._args) |
346 self._ReadGtestFilterFile("layout", script_cmd) | 346 self._ReadGtestFilterFile("layout", script_cmd) |
347 | 347 |
348 # Now run script_cmd with the wrapper in cmd | 348 # Now run script_cmd with the wrapper in cmd |
349 cmd.extend(["--"]) | 349 cmd.extend(["--"]) |
350 cmd.extend(script_cmd) | 350 cmd.extend(script_cmd) |
351 supp = self.Suppressions() | 351 supp = self.Suppressions() |
352 return heapcheck_test.RunTool(cmd, supp) | 352 return heapcheck_test.RunTool(cmd, supp, "layout") |
353 | 353 |
354 def TestLayout(self): | 354 def TestLayout(self): |
355 '''Runs the layout tests.''' | 355 '''Runs the layout tests.''' |
356 # A "chunk file" is maintained in the local directory so that each test | 356 # A "chunk file" is maintained in the local directory so that each test |
357 # runs a slice of the layout tests of size chunk_size that increments with | 357 # runs a slice of the layout tests of size chunk_size that increments with |
358 # each run. Since tests can be added and removed from the layout tests at | 358 # each run. Since tests can be added and removed from the layout tests at |
359 # any time, this is not going to give exact coverage, but it will allow us | 359 # any time, this is not going to give exact coverage, but it will allow us |
360 # to continuously run small slices of the layout tests under purify rather | 360 # to continuously run small slices of the layout tests under purify rather |
361 # than having to run all of them in one shot. | 361 # than having to run all of them in one shot. |
362 chunk_size = self._options.num_tests | 362 chunk_size = self._options.num_tests |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 return 0 | 440 return 0 |
441 | 441 |
442 | 442 |
443 if __name__ == "__main__": | 443 if __name__ == "__main__": |
444 if sys.platform == 'linux2': | 444 if sys.platform == 'linux2': |
445 ret = _main(sys.argv) | 445 ret = _main(sys.argv) |
446 else: | 446 else: |
447 logging.error("Heap checking works only on Linux at the moment.") | 447 logging.error("Heap checking works only on Linux at the moment.") |
448 ret = 1 | 448 ret = 1 |
449 sys.exit(ret) | 449 sys.exit(ret) |
OLD | NEW |