Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Side by Side Diff: tools/heapcheck/chrome_tests.py

Issue 596085: Make the heapheck runner recognize the sanity tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/heapcheck/heapcheck_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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)
OLDNEW
« no previous file with comments | « no previous file | tools/heapcheck/heapcheck_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698